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.
Selva R. (Guest)
on 2008-12-17 08: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.....
Thorsten M. (Guest)
on 2008-12-17 12: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.
Selva R. (Guest)
on 2008-12-18 04:44
Thorsten M. 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.