]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/map_bug.rb
Allow for different formats to the getBugs call
[rails.git] / app / models / map_bug.rb
index 0a00398723856bd95e79fe9b3ab721ee82beb3f6..e04e180be2a7b40bac4d5033a86525481b107f69 100644 (file)
@@ -29,4 +29,20 @@ class MapBug < ActiveRecord::Base
        self.save;
   end
 
+  def flatten_comment ( separator_char )
+       resp = ""
+       comment_no = 1
+       self.map_bug_comment.each do |comment|
+        resp += (comment_no == 1 ? "" : separator_char)
+               resp += comment.comment if comment.comment
+               resp += " [ " 
+               resp += comment.commenter_name if comment.commenter_name
+               resp += " " + comment.date_created.to_s + " ]"
+               comment_no += 1
+       end
+
+       return resp
+
+  end
+
 end