title: Rails: if has_many relationship changed
body: <p>I've got these two classes. </p>
  
  <pre><code>class Article &lt; ActiveRecord::Base
    attr_accessible :body, :issue, :name, :page, :image, :video, :brand_ids
    has_many :publications
    has_many :docs, :through =&gt; :publications
  end
  
  class Doc &lt; ActiveRecord::Base
    attr_accessible :issue_id, :cover_id, :message, :article_ids, :user_id, :created_at, :updated_at, :issue_code, :title, :template_id
    has_many :publications, dependent: :destroy
    has_many :articles, :through =&gt; :publications, :order =&gt; 'publications.position'
    has_many :edits, dependent: :destroy
    accepts_nested_attributes_for :articles, allow_destroy: false
  end
  </code></pre>
  
  <p>How would I write a conditional statement to see if <code>@doc.articles</code> has changed after updating <code>@doc</code>?</p>
  
  <pre><code>if @doc.articles.changed?
    ...
  end
  </code></pre>
  
  <p>The above gives me an error. I can't find the correct syntax.</p>