#17 new
Asfand Yar Qazi

Deciding on order that seed files are run

Reported by Asfand Yar Qazi | June 11th, 2009 @ 02:13 AM

Hi,

So I've got the typical set up of a model that belongs_to several others (i.e. has the foreign keys for the other models).

So there's y and z which don't need anything; but A requires and y_id and z_id.

in a.rb I'm trying to do:

record.y = Y.find_by_name('blah')
record.z = Z.find_by_name('blah')

It always loads up a.rb FIRST, when I want it loaded up after y and z. I tried renaming them to 10-y.rb, 20-z.rb and 30-a.rb hoping that would let me define the ordering - but it doesn't. Any ideas?

Thanks

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

An attempt to simplify the usage of seed data in Rails applications through a dead simple API.

People watching this ticket

Pages