mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Remove unused options param for token_auth schema, and avoid creating a new hash
This commit is contained in:
parent
6a09daf570
commit
98e69cfd71
3 changed files with 8 additions and 6 deletions
|
@ -16,7 +16,7 @@ module Devise
|
|||
# Tell how to apply schema methods
|
||||
def apply_devise_schema(name, type, options={})
|
||||
type = Time if type == DateTime
|
||||
field name, { :type => type }.merge(options)
|
||||
field name, { :type => type }.merge!(options)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -26,4 +26,4 @@ end
|
|||
Mongoid::Document::ClassMethods.class_eval do
|
||||
include Devise::Models
|
||||
include Devise::Orm::Mongoid::Hook
|
||||
end
|
||||
end
|
||||
|
|
|
@ -18,7 +18,7 @@ module Devise
|
|||
|
||||
apply_devise_schema :email, String, :null => null, :default => default
|
||||
apply_devise_schema :encrypted_password, String, :null => null, :default => default, :limit => 128
|
||||
end
|
||||
end
|
||||
|
||||
# Creates password salt for encryption support.
|
||||
def encryptable
|
||||
|
@ -26,7 +26,7 @@ module Devise
|
|||
end
|
||||
|
||||
# Creates authentication_token.
|
||||
def token_authenticatable(options={})
|
||||
def token_authenticatable
|
||||
apply_devise_schema :authentication_token, String
|
||||
end
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ module SharedAdmin
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
devise :database_authenticatable, :encryptable, :registerable, :timeoutable, :recoverable, :rememberable, :lockable, :unlock_strategy => :time
|
||||
devise :database_authenticatable, :encryptable, :registerable,
|
||||
:timeoutable, :recoverable, :rememberable, :lockable,
|
||||
:unlock_strategy => :time
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue