Always get the bug commenter name from the user if there is one
This commit is contained in:
parent
a2495c843e
commit
63e9c4771a
3 changed files with 11 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue