From dd03f44968e101b22ad42f377090926403a72105 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 18 Mar 2013 20:54:29 -0700 Subject: [PATCH] optimise --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 506b57cea..1930ce085 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -506,7 +506,7 @@ class User < ActiveRecord::Base def add_trust_level # there is a possiblity we did no load trust level column, skip it - return unless attributes.key? "trust_level" + return unless attribute_present? :trust_level self.trust_level ||= SiteSetting.default_trust_level end