I want to create a record with a manually-set custom ID, for instance:

Foo.create(:id => 8000, :name =>"bar")

But when I try to do that, Rails ignores the id I pass and continues
to auto-increment the id in the table. So in other words the console
output is along the lines of:

>> Foo.find(:last)
=> #<Foo id: 52, name: "foo">
>> Foo.create(:id => 8000, :name =>"bar")
=> #<Foo id: 53, name: "bar">

What's the best way around this? (By the way, after I insert this
record with the custom ID, I *do* want it to revert back to auto-
incrementing the id.)

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to