Working around mysql bug...
authorMatt Amos <zerebubuth@gmail.com>
Tue, 26 May 2009 16:55:05 +0000 (16:55 +0000)
committerMatt Amos <zerebubuth@gmail.com>
Tue, 26 May 2009 16:55:05 +0000 (16:55 +0000)
app/models/old_relation.rb
app/models/old_way.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
 
index 425478a5b93a81586d6849081fc296f4583bf680..dc5715693af0328e5e7d0a8b005dd346528f2eb3 100644 (file)
@@ -30,7 +30,7 @@ class OldWay < ActiveRecord::Base
     save!
     clear_aggregation_cache
     clear_association_cache
-    @attributes.update(OldWay.find(:first, :conditions => ['id = ? AND timestamp = ?', self.id, self.timestamp]).instance_variable_get('@attributes'))
+    @attributes.update(OldWay.find(:first, :conditions => ['id = ? AND timestamp = ?', self.id, self.timestamp], :order => "version desc").instance_variable_get('@attributes'))
 
     # ok, you can touch from here on