Module: Devise::Orm::MongoMapper
- Includes:
- Schema
- Defined in:
- lib/devise/orm/mongo_mapper.rb
Defined Under Namespace
Modules: InstanceMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#apply_schema(name, type, options = {}) ⇒ Object
Tell how to apply schema methods.
- #find(*args) ⇒ Object
Methods included from Schema
#authenticatable, #confirmable, #lockable, #recoverable, #rememberable, #token_authenticatable, #trackable
Class Method Details
.included_modules_hook(klass) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/devise/orm/mongo_mapper.rb', line 14 def self.included_modules_hook(klass) klass.send :extend, self klass.send :include, InstanceMethods yield klass.devise_modules.each do |mod| klass.send(mod) if klass.respond_to?(mod) end end |
Instance Method Details
#apply_schema(name, type, options = {}) ⇒ Object
Tell how to apply schema methods. This automatically converts DateTime to Time, since MongoMapper does not recognize the former.
40 41 42 43 44 |
# File 'lib/devise/orm/mongo_mapper.rb', line 40 def apply_schema(name, type, ={}) return unless Devise.apply_schema type = Time if type == DateTime key name, type, end |
#find(*args) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/devise/orm/mongo_mapper.rb', line 24 def find(*args) = args. case args.first when :first first() when :all all() else super end end |