]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/note.rb
Added description and author_id methods to Note
[rails.git] / app / models / note.rb
index 6d8ca078fa42e1d12e1652e3795a1e32caf02c26..d23f458e51f6ca80a7f6aea61363353ee7724fd9 100644 (file)
@@ -82,12 +82,22 @@ class Note < ApplicationRecord
     closed_at + DEFAULT_FRESHLY_CLOSED_LIMIT
   end
 
-  # Return the author object, derived from the first comment
+  # Return the note's description, derived from the first comment
+  def description
+    comments.first.body
+  end
+
+  # Return the note's author object, derived from the first comment
   def author
     comments.first.author
   end
 
-  # Return the author IP address, derived from the first comment
+  # Return the note's author ID, derived from the first comment
+  def author_id
+    comments.first.author_id
+  end
+
+  # Return the note's author IP address, derived from the first comment
   def author_ip
     comments.first.author_ip
   end