X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/2e1d9f3348c0daa482397049d009e26bbedc00bd..6f88f4d03fbe43b7005921192589966dd589affe:/app/models/note.rb?ds=sidebyside diff --git a/app/models/note.rb b/app/models/note.rb index 76c5e5308..c32b1679b 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -14,11 +14,13 @@ 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 def validate_position - errors.add_to_base("Note is not in the world") unless in_world? + errors.add(:base, "Note is not in the world") unless in_world? end # Close a note