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
that?

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

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