]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/note.rb
Make the API reject changes to closed notes
[rails.git] / app / models / note.rb
index 801e1f3cbee16a2a9c74014321cdd6490ae41ac7..bb56c5ce0d6e73612b3358b1bdf9cc84226cc0b3 100644 (file)
@@ -52,6 +52,11 @@ class Note < ActiveRecord::Base
     status != "hidden"
   end
 
+  # Check if a note is closed
+  def closed?
+    not closed_at.nil?
+  end
+
   # Return the author object, derived from the first comment
   def author
     self.comments.first.author