2010-03-04 08:33:26 +00:00
|
|
|
class User
|
|
|
|
include MongoMapper::Document
|
|
|
|
|
|
|
|
devise :authenticatable, :recoverable, :rememberable, :trackable
|
|
|
|
|
2010-03-15 08:13:26 +00:00
|
|
|
key :use_attributes, Array
|
2010-03-08 09:14:59 +00:00
|
|
|
|
|
|
|
def method_missing(method)
|
|
|
|
safe_read(method)
|
|
|
|
end
|
|
|
|
|
|
|
|
def safe_read(key)
|
|
|
|
self[key]
|
|
|
|
rescue MongoMapper::KeyNotFound
|
|
|
|
return ""
|
|
|
|
end
|
|
|
|
|
2010-03-04 08:33:26 +00:00
|
|
|
end
|