1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Set the new default for reconfirmable config

This commit is contained in:
Ulisses Almeida 2016-04-26 18:02:51 -03:00
parent 93df02f601
commit 6e419ce821
4 changed files with 5 additions and 19 deletions

View file

@ -143,20 +143,8 @@ module Devise
@@confirmation_keys = [:email]
# Defines if email should be reconfirmable.
# False by default for backwards compatibility.
# TODO: 4.1 Do: @@reconfirmable = true
mattr_reader :reconfirmable
@@reconfirmable = false
def self.reconfirmable=(reconfirmable)
app_set_configs << :reconfirmable
@@reconfirmable = reconfirmable
end
def reconfirmable=(reconfirmable)
app_set_configs << :reconfirmable
@@reconfirmable = reconfirmable
end
mattr_accessor :reconfirmable
@@reconfirmable = true
# Time interval to timeout the user session without activity.
mattr_accessor :timeout_in
@ -319,7 +307,6 @@ module Devise
def self.setup
yield self
warn_default_config_changed(:reconfirmable, 'false', 'true')
warn_default_config_changed(:sign_out_via, ':get', ':delete')
warn_default_config_changed(:skip_session_storage, '[]', '[:http_auth]')
end

View file

@ -38,7 +38,6 @@ class DeviseTest < ActiveSupport::TestCase
test 'setup block warns about defaults changing' do
Devise.app_set_configs = Set.new
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /reconfirmable/ }
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /sign_out_via/ }
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /skip_session_storage/ }
@ -50,7 +49,6 @@ class DeviseTest < ActiveSupport::TestCase
ActiveSupport::Deprecation.expects(:warn).never
swap Devise,
reconfirmable: false,
sign_out_via: :get,
skip_session_storage: [] do
Devise.setup do

View file

@ -4,7 +4,8 @@ module SharedUser
included do
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
:registerable, :rememberable, :timeoutable,
:trackable, :validatable, :omniauthable, password_length: 7..72
:trackable, :validatable, :omniauthable, password_length: 7..72,
reconfirmable: false
attr_accessor :other_key

View file

@ -4,7 +4,7 @@ module SharedUserWithoutOmniauth
included do
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
:registerable, :rememberable, :timeoutable,
:trackable, :validatable
:trackable, :validatable, reconfirmable: false
end
def raw_confirmation_token