rescue [] user.active_attributes when nil

This commit is contained in:
chris authored and ihower committed 2011-04-13 18:22:50 +08:00
1 parent e6546fdc19
commit 73b75ec0b6
1 file changed
+1 -1
+1 -1
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