Working around mysql bug...
[rails.git] / app / models / old_relation.rb
index 6f364225b9b079a87429bf6daba16cb70b07c177..ca43b59127c923b6dde9d0e6cebcb2ae9136807b 100644 (file)
@@ -25,7 +25,7 @@ class OldRelation < ActiveRecord::Base
     save!
     clear_aggregation_cache
     clear_association_cache
-    @attributes.update(OldRelation.find(:first, :conditions => ['id = ? AND timestamp = ?', self.id, self.timestamp]).instance_variable_get('@attributes'))
+    @attributes.update(OldRelation.find(:first, :conditions => ['id = ? AND timestamp = ?', self.id, self.timestamp], :order => "version desc").instance_variable_get('@attributes'))
 
     # ok, you can touch from here on