# Adding associate objects without persistence operation

**URL:** <https://www.ruby-forum.com/t/adding-associate-objects-without-persistence-operation/175374>\
**Category:** Rails\
**Created:** [September 11, 2009, 10:46pm UTC](https://www.ruby-forum.com/t/adding-associate-objects-without-persistence-operation/175374 "2009-09-11T22:46:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9d8465/32.png) [@stefans](https://www.ruby-forum.com/u/stefans)\
**Post date:** [September 11, 2009, 10:46pm UTC](https://www.ruby-forum.com/t/adding-associate-objects-without-persistence-operation/175374/1 "2009-09-11T22:46:13Z")

</div>

Hello,

I have two models, Publication and Person, that are connected via a has  
many - through association (join-model: Contribution). I have a  
Publication-object that has already been persisted (i.e. new\_record?  
evaluates to false) and would like to do the following:

1. adding a Person-object that has already been persisted as well to  
that publication without the new relationship automatically being saved  
on db-level  
(.i.e. no new record should be added to the contributions-join table  
automatically)

2. removing a Person-object from the publication without automatically  
deleting the contributions-record on db-level that links the publication  
and the person

As far as I know the methods ‘publication.people \<\<’ (and similar stuff  
like concat and push) as well as ‘publication.people delete’ will  
automatically perform the persistence-operations I would like to avoid.  
The only method that allows to add associates without performing  
persistence operations is publication.people.build. But that only adds a  
new person (new\_record? = true), not one which has already been saved.

So my question is:  
IS there any way to achieve 1) or/and 2), or is Active-Record with its  
tight coupling of objects and db-records just the ‘wrong’  
object-relational mapper to achieve this?
