Assign object


#1

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…


#2

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.


#3

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!’