Read more

Change the id of an ActiveRecord record

Tobias Kraze
November 11, 2010Software engineer at makandra GmbH

You most likely never want to do this. But if you do:

Model.update_all({:id => new_id}, {:id => old_id})
Illustration online protection

Rails professionals since 2007

Our laser focus on a single technology has made us a leader in this space. Need help?

  • We build a solid first version of your product
  • We train your development team
  • We rescue your project in trouble
Read more Show archive.org snapshot
Posted by Tobias Kraze to makandra dev (2010-11-11 15:06)