Always get the bug commenter name from the user if there is one

This commit is contained in:
Tom Hughes 2011-05-07 17:47:05 +01:00
parent a2495c843e
commit 63e9c4771a
3 changed files with 11 additions and 15 deletions

View file

@ -9,4 +9,12 @@ class MapBugComment < ActiveRecord::Base
validates_uniqueness_of :id
validates_presence_of :visible
validates_presence_of :date_created
def commenter_name
if self.commenter_id.nil?
self.read_attribute(:commenter_name)
else
self.user.display_name
end
end
end