Forum: Ruby on Rails assign object

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
195b026049dbc00fe8096598f18a5312?d=identicon&s=25 Selva Raj (selva_rails)
on 2008-12-17 07:23
Hi all,

I am trying to do little bit beyond params.. means I try to assign one
active record object to another object as update attributes both have
same field. Before that I want to remove id field from old object. Is
there way to remove attributes from object and to assign new object??

If any one knows.....
2d8132658d56e51f19ace1c68e48b6aa?d=identicon&s=25 Thorsten Mueller (thorsten)
on 2008-12-17 11:13
(Received via mailing list)
clone() would do that

Returns a clone of the record that hasn‘t been assigned an id yet and
is treated as a new record. Note that this is a "shallow" clone: it
copies the object‘s attributes only, not its associations.
195b026049dbc00fe8096598f18a5312?d=identicon&s=25 Selva Raj (selva_rails)
on 2008-12-18 03:44
Thorsten Mueller wrote:
> clone() would do that
>
> Returns a clone of the record that hasn�t been assigned an id yet and
> is treated as a new record. Note that this is a "shallow" clone: it
> copies the object�s attributes only, not its associations.

Thanks for you reply..


But I am getting error..

NoMethodError: undefined method `stringify_keys!'
This topic is locked and can not be replied to.