rescue [] user.active_attributes when nil

This commit is contained in:
chris 2011-01-31 18:10:44 +08:00 committed by ihower
parent e6546fdc19
commit 73b75ec0b6
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ class User
# Get the active user_attribute_models
def get_active_attribute_models
self.active_attributes.map{ |attr| get_attribute_model(attr) }
self.active_attributes.map{ |attr| get_attribute_model(attr) } rescue []
end
# Get an user_attribute_model from key