# Observing HABTM-associations with observers

**URL:** <https://www.ruby-forum.com/t/observing-habtm-associations-with-observers/104194>\
**Category:** Rails\
**Created:** [May 15, 2007, 9:52am UTC](https://www.ruby-forum.com/t/observing-habtm-associations-with-observers/104194 "2007-05-15T09:52:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixellover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pixellover](https://www.ruby-forum.com/u/pixellover)\
**Post date:** [May 15, 2007, 9:52am UTC](https://www.ruby-forum.com/t/observing-habtm-associations-with-observers/104194/1 "2007-05-15T09:52:27Z")

</div>

I’m trying to write an observer which tracks changes to my data. This  
seems to  
be an impossible for habtm-associations as all hooks in an observer just  
works for models. As habtm-associatons gets saved when they’re added to  
a  
collection I haven’t found a way to get an observer called. What’s a  
good  
solution to this problem?

I really wonder why there isn’t a way of adding objects to a collection  
without instantly creating an entry in the join table an just create  
these  
entry when the parent object is saved?

Regards,  
Timo
