X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/eac7348ad2793cb3ad72c68bef84ff863af92d5f..d0e291552e5da004f1582d7ce577b8ccf7f546df:/app/models/map_bug.rb diff --git a/app/models/map_bug.rb b/app/models/map_bug.rb index 0a0039872..e04e180be 100644 --- a/app/models/map_bug.rb +++ b/app/models/map_bug.rb @@ -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