]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/map_bug.rb
Add methods to get a bug's author details from the first comment
[rails.git] / app / models / map_bug.rb
index 2ae110bf2fcc897c30f56f8dde60f60c5e9641be..7094bfe5e7b983d373f0e8ef66d437d07f46c7c7 100644 (file)
@@ -46,4 +46,20 @@ class MapBug < ActiveRecord::Base
   def visible
     return status != "hidden"
   end
+
+  def author
+    self.comments.first.author
+  end
+
+  def author_ip
+    self.comments.first.author_ip
+  end
+
+  def author_id
+    self.comments.first.author_id
+  end
+
+  def author_name
+    self.comments.first.author_name
+  end
 end