# Cloning AR doesn't clone associations?

**URL:** <https://www.ruby-forum.com/t/cloning-ar-doesnt-clone-associations/47639>\
**Category:** Rails\
**Created:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/cloning-ar-doesnt-clone-associations/47639 "2005-11-12T12:49:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeroen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bbe5ce/32.png) [@jeroen](https://www.ruby-forum.com/u/jeroen)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/cloning-ar-doesnt-clone-associations/47639/1 "2005-11-12T12:49:50Z")

</div>

Hi,

Am I right in thinking that cloning an ActiveRecord does not close its  
associations? If so, any particluar reason for this?

Jeroen

---

<div class="post-metadata">

**Author:** ![jeroen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bbe5ce/32.png) [@jeroen](https://www.ruby-forum.com/u/jeroen)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/cloning-ar-doesnt-clone-associations/47639/2 "2005-11-12T12:49:50Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

On Nov 10, 2005, at 12:26 PM, Jeroen H. wrote:

> Am I right in thinking that cloning an ActiveRecord does not close  
> its associations? If so, any particluar reason for this?

Because how deep you go in the object graph is application-specific.

jeremy  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDc7XSAQHALep9HFYRApnBAJwNP7C1rsbS+LZ7SV2TCgsNz3c+eQCgjtk/  
bV5tQhZrm9GW7g//HfllpNI=  
=9w0M  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![jeroen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bbe5ce/32.png) [@jeroen](https://www.ruby-forum.com/u/jeroen)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/cloning-ar-doesnt-clone-associations/47639/3 "2005-11-12T12:49:51Z")

</div>

Jeremy K. wrote:

> -----BEGIN PGP SIGNED MESSAGE-----  
> Hash: SHA1
> 
> On Nov 10, 2005, at 12:26 PM, Jeroen H. wrote:
> 
> > Am I right in thinking that cloning an ActiveRecord does not close  
> > its associations? If so, any particluar reason for this?
> 
> Because how deep you go in the object graph is application-specific.

Okay. Makes sense. Perhaps this can be added to the API docs.

Thanks for your help!

Jeroen

---

<div class="post-metadata">

**Author:** ![jeroen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bbe5ce/32.png) [@jeroen](https://www.ruby-forum.com/u/jeroen)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/cloning-ar-doesnt-clone-associations/47639/4 "2005-11-12T12:49:52Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

On Nov 10, 2005, at 1:22 PM, Jeroen H. wrote:

> Jeremy K. wrote:
> 
> > On Nov 10, 2005, at 12:26 PM, Jeroen H. wrote:
> > 
> > > Am I right in thinking that cloning an ActiveRecord does not  
> > > close its associations? If so, any particluar reason for this?
> > 
> > Because how deep you go in the object graph is application-specific.
> 
> Okay. Makes sense. Perhaps this can be added to the API docs.

Sure: [http://dev.rubyonrails.org/changeset/2975](http://dev.rubyonrails.org/changeset/2975)

jeremy  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDc76OAQHALep9HFYRAnLUAKCImfKrN48GHV8qb3oBPo6d4MgJ+QCeNFKp  
/Ar7DUAkGf5R2QF+WyHW7MA=  
=eReL  
-----END PGP SIGNATURE-----
