X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ca30b879f6eba3f513bcfa53545dba43d09b2023..59d5b5fa6eb09e159771d170f0831ec49283c91a:/app/models/note.rb diff --git a/app/models/note.rb b/app/models/note.rb index 9dc122721..27357e58a 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -11,6 +11,9 @@ class Note < ActiveRecord::Base validates_inclusion_of :status, :in => ["open", "closed", "hidden"] validate :validate_position + scope :visible, -> { where("status != 'hidden'") } + scope :invisible, -> { where("status = 'hidden'") } + after_initialize :set_defaults # Sanity check the latitude and longitude and add an error if it's broken