X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ca30b879f6eba3f513bcfa53545dba43d09b2023..15f0367e7fb8bf78059759414d7ec0d3dcceb42a:/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