]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_relation.rb
Wait for the page to finish loading before trying to add any data
[rails.git] / app / models / old_relation.rb
index b2fdf926e1c353720a40b362e03eafcdd8bd2a28..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
 
@@ -81,7 +81,7 @@ class OldRelation < ActiveRecord::Base
 #  has_many :relation_tags, :class_name => 'OldRelationTag', :foreign_key => 'id'
 
   def old_members
-    OldRelationMember.find(:all, :conditions => ['id = ? AND version = ?', self.id, self.version])    
+    OldRelationMember.find(:all, :conditions => ['id = ? AND version = ?', self.id, self.version], :order => "sequence_id")
   end
 
   def old_tags