How to assign a non-auto ID?

On Dec 13, 2007, at 12:42 PM, Sam K. wrote:

I know I can copy the database.
But the structures are so different that I can’t just copy and paste.
Also, I need to apply complex rules.
That’s why I need to use ActiveRecord.

I hope that I explained my intention well.:slight_smile:


If you assign the id ‘manually’, it will be honored, if possible.

mycopy = { |m| = oldid }

… apply complex rules …

Note that you can’t have :id in the hash_of_old_attributes (well, it
will be ignored if present).


(of course, you’re on the forum and may never see this message…)

Rob B.
[email protected]

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