]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/node.rb
Use last_modified method instead of setting the header manually
[rails.git] / app / models / node.rb
index 3a1d580e052b8cc713f6299a57fdb84057bd18e5..3de6e154c15841d8c2b94c75a9a4f9206a7bcbcc 100644 (file)
@@ -8,7 +8,7 @@ class Node < ActiveRecord::Base
 
   belongs_to :changeset
 
-  has_many :old_nodes, :foreign_key => :id
+  has_many :old_nodes, :foreign_key => :id, :order => :version
 
   has_many :way_nodes
   has_many :ways, :through => :way_nodes
@@ -30,6 +30,9 @@ class Node < ActiveRecord::Base
   validate :validate_position
   validates_associated :changeset
 
+  scope :visible, where(:visible => true)
+  scope :invisible, where(:visible => false)
+
   # Sanity check the latitude and longitude and add an error if it's broken
   def validate_position
     errors.add_to_base("Node is not in the world") unless in_world?