]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/note.rb
Use image_url instead of nasty hacks
[rails.git] / app / models / note.rb
index 10b74d8a669a46f431a03b476f94494c38064476..9dc1227218f8a25b9a080223c1485dac49092132 100644 (file)
@@ -1,10 +1,7 @@
 class Note < ActiveRecord::Base
   include GeoRecord
 
-  has_many :comments, :class_name => "NoteComment",
-                      :foreign_key => :note_id,
-                      :order => :created_at,
-                      :conditions => { :visible => true }
+  has_many :comments, -> { where(:visible => true).order(:created_at) }, :class_name => "NoteComment", :foreign_key => :note_id
 
   validates_presence_of :id, :on => :update
   validates_uniqueness_of :id
@@ -14,8 +11,6 @@ class Note < ActiveRecord::Base
   validates_inclusion_of :status, :in => ["open", "closed", "hidden"]
   validate :validate_position
 
-  attr_accessible :lat, :lon
-
   after_initialize :set_defaults
 
   # Sanity check the latitude and longitude and add an error if it's broken