User cert tweaks (handling nulls)

This commit is contained in:
2013-08-24 02:23:12 -07:00
parent 75e4907a9c
commit a1ef8a5fd5
3 changed files with 17 additions and 4 deletions

View File

@@ -5,4 +5,12 @@ class UserCertification < ActiveRecord::Base
belongs_to :user
belongs_to :certification
def user_name
if user.blank?
return "n/a (user ##{user_id} missing)"
else
return self.user.name
end
end
end