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, #database_authenticatable, #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.
37 38 39 40 41 |
# File 'lib/devise/orm/mongo_mapper.rb', line 37 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 |
# File 'lib/devise/orm/mongo_mapper.rb', line 24 def find(*args) case args.first when :first, :all send(args.shift, *args) else super end end |