title: Rails 3, ActiveRecord, Detecting changes in has_many association
body: <p>I have the following associations</p>
  
  <pre><code>class User &lt; ActiveRecord::base 
    has_many :memberships
  end
  </code></pre>
  
  <p>What I would like to do is to detect in the <code>users_controller</code> update action that some memberships have been added or removed from the <code>user.memberships</code>.</p>
  
  <p>Any idea or suggestion on how to implement this?</p>
  
  <p>Thanks for any help.</p>
  
  <p>EDIT: My apologies if the question was not clear.</p>
  
  <p>Users are linked together by a parent-child relationship. This relationship is implemented through memberships to a Family circle.</p>
  
  <p>What I want is that when a child user joins a Classroom circle automagically the parent of the child also joins the same Classroom circle. In other words adding/removing memberships to a child user needs to be propagated to his parents users.</p>