# Object.dup doesn't seem to work

**URL:** <https://www.ruby-forum.com/t/object-dup-doesnt-seem-to-work/111534>\
**Category:** Rails\
**Created:** [August 8, 2007, 11:03am UTC](https://www.ruby-forum.com/t/object-dup-doesnt-seem-to-work/111534 "2007-08-08T11:03:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![giorgio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/cab0a1/32.png) [@giorgio](https://www.ruby-forum.com/u/giorgio)\
**Post date:** [August 8, 2007, 11:03am UTC](https://www.ruby-forum.com/t/object-dup-doesnt-seem-to-work/111534/1 "2007-08-08T11:03:13Z")

</div>

I have an activerecord class object that I do a .dup on.  
When I change the “duped” object it changes he orginal.

Is this normal? I thought it should be a deep copy.

One funny thing I noticed is that virtual attributes that are not part  
of the database do not change but the database mapped attributes do.

Is there a better way to make a copy of the record?

Thanks  
George
