title: Modify Rails has_one relationship to UPDATE instead of DELETE then INSERT
body: <p>I have two models with a <code>has_one</code> relationship:</p>
  
  <pre><code>class Entity &lt; ActiveRecord::Base
  
    has_one :location, as: :locatable, dependent: :destroy
    accepts_nested_attributes_for :location, allow_destroy: true
  
    ...
    default_scope {joins(:location).includes(:location)}
    ...
  
    # has a properties 'name' and 'url'
  
  end
  
  class Location &lt; ActiveRecord::Base
    belongs_to :locatable, polymorphic: true
  
    # has a property named 'address'
  
  end
  </code></pre>
  
  <p>I noticed that changes to the <code>name</code> or <code>url</code> properties of the <code>Entity</code> model via the form will cause the associated <code>Location</code> record to be DELETEd then INSERTed.  This is a less-than-desirable action.</p>
  
  <p>** edit **</p>
  
  <p>In further testing, I noticed that these settings have no bearing on the SQL strategy:</p>
  
  <ul>
  <li><code>polymorphic</code> joins</li>
  <li><code>allow_destroy: true</code></li>
  <li><code>dependent: :destroy</code> - other than leaving an orphaned record in the <code>Locations</code> table</li>
  <li><code>default_scope</code></li>
  </ul>
  
  <p>Questions:</p>
  
  <ol>
  <li>Why is a change to an <code>Entity</code> property causing an change to the <code>Location</code> model?</li>
  <li>Why is this performing a <code>DELETE</code>/<code>INSERT</code>, rather than an <code>UPDATE</code>?</li>
  </ol>