> pi_array_sorted =
> { 'general_event_types',  屬 岬 ݬ
> 'prices', [Price1, Price2, ..],
> 'specific_event_types', [SpecificEventType1, SpecificEventType2, ..],
> 'general_event_types',  򲮮>
> So the keys should be in alphabetical order, but they arent, at least
> not when I iterate over the array using
>

This code above doesn't create an array, it creates an Hash, and Hash
doesn't preserve order.
Do the following:

pi_array_sorted = [
  ['general_event_types',  [GeneralEventType1,
GeneralEventType2, ..]],
  ['prices',               [Price1, Price2, ..]],
  ['specific_event_types', [SpecificEventType1,
SpecificEventType2, ..]],
  ['general_event_types',  [Teacher1, Teacher2, ..]]
]

pi_array_sorted.each do |key,value|
  # do stuff here
end

Cheers