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

Methods included from Schema

#authenticatable, #confirmable, #lockable, #recoverable, #rememberable, #trackable

Class Method Details

.included_modules_hook(klass, modules) ⇒ 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, modules)
  klass.send :extend,  self
  klass.send :include, InstanceMethods
  yield

  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.



28
29
30
31
32
# File 'lib/devise/orm/mongo_mapper.rb', line 28

def apply_schema(name, type, options={})
  return unless Devise.apply_schema
  type = Time if type == DateTime
  key name, type, options
end