add rough user attributes API
This commit is contained in:
1 parent
29ee4585b2
commit
a40b117fbe
6 files changed
+32
-11
No files matched your search
+12
-2
@@ -3,6 +3,16 @@ class User
|
||||
|
||||
devise :authenticatable, :recoverable, :rememberable, :trackable
|
||||
|
||||
key :use_attributes
|
||||
|
||||
# key :use_attributes
|
||||
|
||||
def method_missing(method)
|
||||
safe_read(method)
|
||||
end
|
||||
|
||||
def safe_read(key)
|
||||
self[key]
|
||||
rescue MongoMapper::KeyNotFound
|
||||
return ""
|
||||
end
|
||||
|
||||
end
|
||||
@@ -2,7 +2,7 @@ class UserAttribute
|
||||
|
||||
include MongoMapper::Document
|
||||
|
||||
key :ident, String
|
||||
key :key, String
|
||||
key_i18n :name, String
|
||||
key_i18n :attrs, Array
|
||||
|
||||
|
||||
Reference in new issue
Block a user