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
|
||||
* [#35] Moved friendly_token to Devise
|
||||
* 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
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ module Devise
|
|||
: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
|
||||
@@pepper = nil
|
||||
|
||||
|
@ -64,10 +64,15 @@ module Devise
|
|||
mattr_accessor :orm
|
||||
@@orm = :active_record
|
||||
|
||||
# Configure default options used in :all
|
||||
# Configure default options used in :all.
|
||||
mattr_accessor :all
|
||||
@@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
|
||||
# Default way to setup Devise. Run script/generate devise_install to create
|
||||
# a fresh initializer with all configuration values.
|
||||
|
|
|
@ -12,8 +12,11 @@ module Devise
|
|||
|
||||
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={})
|
||||
return unless Devise.apply_schema
|
||||
type = Time if type == DateTime
|
||||
key name, type, options
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue