From 98be42e9f939634bbfb397b5ce53188aacca6882 Mon Sep 17 00:00:00 2001 From: Will Bradley Date: Mon, 26 Aug 2013 22:11:04 -0700 Subject: [PATCH] Fixing nil errors --- app/models/user_certification.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/user_certification.rb b/app/models/user_certification.rb index 649c48e..54c2891 100644 --- a/app/models/user_certification.rb +++ b/app/models/user_certification.rb @@ -7,6 +7,10 @@ class UserCertification < ActiveRecord::Base belongs_to :certification def user_name - self.user.name unless self.user.blank? + if self.user.blank? + "" + else + self.user.name + end end end