title: Rails - Changing association doesn't mark object as dirty
body: <p><strong>Edit</strong>: Clarifications added</p>
  
  <p>Given the following two classes</p>
  
  <pre><code>class Foo &lt; ActiveRecord::Base
    belongs_to :bar
  end
  
  class Bar &lt; ActiveRecord::Base
  end
  </code></pre>
  
  <p>When I change a bar on a foo, I would like a way to see that the foo instance has changed:</p>
  
  <pre><code>foo = Foo.find(x)
  foo.bar      # returns #&lt;Bar id:1&gt;
  foo.bar = Bar.new
  foo.changed? # returns false
  foo.changes  # returns an empty hash
  </code></pre>
  
  <p>I don't want to set bar_id as dirty (because it hasn't changed)  It would be nice to have the following:</p>
  
  <pre><code>foo.changed? # returns true
  foo.changes  # returns {:bar =&gt; [#&lt;Bar id: 1&gt;, nil]}
  </code></pre>
  
  <p>Is there a clever way to hack this into Rails?  Is there a reason this is not part of Rails?</p>