On Fri, Mar 6, 2009 at 10:35 AM, Fresh Mix <[email protected]> wrote: > > What is the easiest way to replace record in database? > > Better that this: > > @old = Order.find(5) > @new = Order.find(90) > > @old.x = @new.x > @old.y = @new.y
@old.attributes = @new.attributes or you can even get rid of @new completely @old.attributes = Order.find(90).attributes @old.save --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

