Mongomapper ORM now converts DateTime to Time.
This commit is contained in:
parent
680cb0f95f
commit
4c81ecae53
|
@ -1,6 +1,11 @@
|
||||||
|
* bug fix
|
||||||
|
* MongoMapper now converts DateTime to Time
|
||||||
|
|
||||||
* enhancements
|
* enhancements
|
||||||
* [#35] Moved friendly_token to Devise
|
* [#35] Moved friendly_token to Devise
|
||||||
* Added Devise.all, so you can freeze your app strategies
|
* Added Devise.all, so you can freeze your app strategies
|
||||||
|
* Added Devise.apply_schema, so you can turn it to false in Datamapper or MongoMapper
|
||||||
|
in cases you don't want it be handlded automatically
|
||||||
|
|
||||||
== 0.5.2
|
== 0.5.2
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ module Devise
|
||||||
:authlogic_sha512 => 128
|
:authlogic_sha512 => 128
|
||||||
}
|
}
|
||||||
|
|
||||||
# Used to encrypt password. Please generate one with rake secret
|
# Used to encrypt password. Please generate one with rake secret.
|
||||||
mattr_accessor :pepper
|
mattr_accessor :pepper
|
||||||
@@pepper = nil
|
@@pepper = nil
|
||||||
|
|
||||||
|
@ -64,10 +64,15 @@ module Devise
|
||||||
mattr_accessor :orm
|
mattr_accessor :orm
|
||||||
@@orm = :active_record
|
@@orm = :active_record
|
||||||
|
|
||||||
# Configure default options used in :all
|
# Configure default options used in :all.
|
||||||
mattr_accessor :all
|
mattr_accessor :all
|
||||||
@@all = Devise::ALL.dup
|
@@all = Devise::ALL.dup
|
||||||
|
|
||||||
|
# Tells if devise should apply the schema in ORMs where devise declaration
|
||||||
|
# and schema belongs to the same class (as Datamapper and MongoMapper).
|
||||||
|
mattr_accessor :apply_schema
|
||||||
|
@@apply_schema = true
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
# Default way to setup Devise. Run script/generate devise_install to create
|
# Default way to setup Devise. Run script/generate devise_install to create
|
||||||
# a fresh initializer with all configuration values.
|
# a fresh initializer with all configuration values.
|
||||||
|
|
|
@ -12,12 +12,15 @@ module Devise
|
||||||
|
|
||||||
include Devise::Schema
|
include Devise::Schema
|
||||||
|
|
||||||
# Tell how to apply schema methods.
|
# Tell how to apply schema methods. This automatically converts DateTime
|
||||||
|
# to Time, since MongoMapper does not recognize the former.
|
||||||
def apply_schema(name, type, options={})
|
def apply_schema(name, type, options={})
|
||||||
|
return unless Devise.apply_schema
|
||||||
|
type = Time if type == DateTime
|
||||||
key name, type, options
|
key name, type, options
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
MongoMapper::Document::ClassMethods.send(:include, Devise::Models)
|
MongoMapper::Document::ClassMethods.send(:include, Devise::Models)
|
||||||
|
|
Loading…
Reference in New Issue