On 29 March 2010 05:42, Tom Mac <lists@ruby-forum.com> wrote:
> Hi
> So my question is how can I ensure that even after running rake
> db:seed (rake db:seed_fu) a number of times my primary key ie, id here,
> does not get modified? Should I need to write an update_id function
> again?
If you really need the id to be pre-defined (though why you need to do
this I do not know, it is generally a bad idea) then in your seed code
you could check whether a record of that id already exists and if it
does then update it rather than re-creating it.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment