]> git.openstreetmap.org Git - rails.git/commitdiff
Make sure the associations with segments and old ways are properly ordered.
authorTom Hughes <tom@compton.nu>
Sat, 23 Jun 2007 23:06:48 +0000 (23:06 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 23 Jun 2007 23:06:48 +0000 (23:06 +0000)
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'