Hi all,
I’m trying to set up my test fixtures, and I’ve recently added foreign keys to my database. Each “channel” is owned by a user, so I need to include a valid user id with each fixture. I’m not sure how to set this up. My YAML is the following
Well, you said you've added the foreign keys *to the database* so you may have issues with the order in which your fixtures are loaded. If you just need to have the entries of a single fixture loaded to the database in a particular order, you can replace the default YAML map with an omap (ordered map) type quite easily:
Hi Stephan,
Thanks for the response, I apologize for the delay in my response, I only have time to work on RoR on the weekends. I do have a users file. I have included the text below. As far as ordering, will the ordering plugin be implicitly executed when I run my rake file, or will I have to manually run the target?
#crypted_password: “ce2/iFrNtQ8=\n” # quentin, use only if you’re using 2-way encryption
created_at: <%= 5.days.ago.to_s :db %>
activated_at: <%= 5.days.ago.to_s :db %> # only if you’re activating new signups
activation_code: aaronscode # only if you’re activating new signups
created_at: <%= 1.days.ago.to_s :db %>
enabled: <%= true %>
disabled:
id: 3
login: disabled
email: disabled@example.com
salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
#crypted_password: “ce2/iFrNtQ8=\n” # quentin, use only if you’re using 2-way encryption
created_at: <%= 5.days.ago.to_s :db %>
activated_at: <%= 5.days.ago.to_s :db %> # only if you’re activating new signups
enabled: <%= false %>