From: Matt Amos Date: Tue, 26 May 2009 16:55:05 +0000 (+0000) Subject: Working around mysql bug... X-Git-Tag: live~7338 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/ce667bbbb16a562bc870e76955e3cd5dd8a77bac Working around mysql bug... --- diff --git a/app/models/old_relation.rb b/app/models/old_relation.rb index 6f364225b..ca43b5912 100644 --- a/app/models/old_relation.rb +++ b/app/models/old_relation.rb @@ -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 diff --git a/app/models/old_way.rb b/app/models/old_way.rb index 425478a5b..dc5715693 100644 --- a/app/models/old_way.rb +++ b/app/models/old_way.rb @@ -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