Ordering Fixtures

I’m trying to extract_fixtures using the example from the Recipes book
but I want to extract them in order (by id) Does anyone know how to do

data = sorted_array_of_objects_by_id
file.write data.inject({}) { |hash, record|
hash["#{table_name}_#{i.succ!}"] = record

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs