title: Postgresql & Rails 3 - Update_attribute on elements in an array reorders the array..why?
body: <p>Postgresql / Rails 3 / Ruby 1.9.2 / OSX</p>
  
  <pre><code>class Deliverable &lt; ActiveRecord::Base
    has_many :models, :dependent =&gt; :destroy
  
    def build_template
      models &lt;&lt; sect_letterhead &lt;&lt; sect_ica &lt;&lt; sect_project_description_exhibit
    end
  
  end
  
  
  
  ruby-1.9.2-p180 :002 &gt; d.models.first
   =&gt; #&lt;Model id: 1, company_id: nil, deliverable_id: 1, model_id: nil, type: nil, kind: "cover_page", csv_file_name: nil, csv_content_type: nil, csv_file_size: nil, csv_updated_at: nil&gt; 
  
  ruby-1.9.2-p180 :003 &gt; d.models.first.update_attribute(:csv_file_name, "blah")
   =&gt; true 
  
  ruby-1.9.2-p180 :004 &gt; d.models.first
   =&gt; #&lt;Model id: 5, company_id: nil, deliverable_id: 1, model_id: nil, type: nil, kind: "opening_letter", csv_file_name: nil, csv_content_type: nil, csv_file_size: nil, csv_updated_at: nil&gt; 
  </code></pre>
  
  <p><strong>Whenever I update_attribute a model, that model is pushed to the end of the array.</strong>  Is there any way other than assigning a custom sort attribute to avoid changing the array order when update_attribute is called?  I could fairly easily do this, but I am interested in the behavior of the database.  </p>
  
  <p><strong>Even when I remove the timestamps from the model object, the behavior remains.</strong>  </p>
  
  <p>How does this occur if there are no timestamps to keep track of which model was just updated?  Or is the model actually pulled out of the array and put back in the last position when I call update_attribute?</p>