]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/way.rb
Make sure the associations with segments and old ways are properly ordered.
[rails.git] / app / models / way.rb
index 5a26e221684fbcd7b6ac87d37bee4811c2365391..9658a99291a2b6655013b5c8a4df533f47bf623f 100644 (file)
@@ -3,10 +3,10 @@ class Way < ActiveRecord::Base
   
   belongs_to :user
 
-  has_many :way_segments, :foreign_key => 'id'
+  has_many :way_segments, :foreign_key => 'id', :order => 'sequence_id'
   has_many :way_tags, :foreign_key => 'id'
 
-  has_many :old_ways, :foreign_key => :id
+  has_many :old_ways, :foreign_key => 'id', :order => 'version'
 
   set_table_name 'current_ways'