# Object duplication

**URL:** <https://www.ruby-forum.com/t/object-duplication/87853>\
**Category:** Rails\
**Created:** [March 6, 2007, 12:23pm UTC](https://www.ruby-forum.com/t/object-duplication/87853 "2007-03-06T12:23:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eizesus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e95f7d/32.png) [@eizesus](https://www.ruby-forum.com/u/eizesus)\
**Post date:** [March 6, 2007, 12:23pm UTC](https://www.ruby-forum.com/t/object-duplication/87853/1 "2007-03-06T12:23:30Z")

</div>

Hi all,

supposed i have a “User” class, which has\_many :companies for example.  
now, if i want to simply clone an instance of such class, how do i  
automatically copy all dependencies together ?

Tnx
