X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/67dd9e4c9d487bdb5f38a09dc0c99def4989326e..59d5b5fa6eb09e159771d170f0831ec49283c91a:/app/models/way.rb diff --git a/app/models/way.rb b/app/models/way.rb index 9bd792ddc..58a9214fa 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -8,10 +8,10 @@ class Way < ActiveRecord::Base belongs_to :changeset - has_many :old_ways, :order => 'version' + has_many :old_ways, -> { order(:version) } - has_many :way_nodes, :order => 'sequence_id' - has_many :nodes, :through => :way_nodes, :order => 'sequence_id' + has_many :way_nodes, -> { order(:sequence_id) } + has_many :nodes, -> { order("sequence_id") }, :through => :way_nodes has_many :way_tags @@ -26,8 +26,8 @@ class Way < ActiveRecord::Base validates_numericality_of :id, :on => :update, :integer_only => true validates_associated :changeset - scope :visible, where(:visible => true) - scope :invisible, where(:visible => false) + scope :visible, -> { where(:visible => true) } + scope :invisible, -> { where(:visible => false) } # Read in xml as text and return it's Way object representation def self.from_xml(xml, create=false)