From e62bb9922e216ded295cb0f6b9ce7b12e76c545a Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 10 Mar 2013 19:11:33 -0700 Subject: [PATCH] exceptions are BAD the old code wacked on 10ms to every home page request, for no real reason. --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index dad849c5f09..1d91355b264 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -501,9 +501,9 @@ class User < ActiveRecord::Base end def add_trust_level + # there is a possiblity we did no load trust level column, skip it + return unless attributes.key? "trust_level" self.trust_level ||= SiteSetting.default_trust_level - rescue ActiveModel::MissingAttributeError - # Ignore it, safely - see http://www.tatvartha.com/2011/03/activerecordmissingattributeerror-missing-attribute-a-bug-or-a-features/ end def update_username_lower