Added required_fields to rememberable
This commit is contained in:
parent
18aef6ac33
commit
bee87843b4
|
@ -41,6 +41,10 @@ module Devise
|
|||
|
||||
attr_accessor :remember_me, :extend_remember_period
|
||||
|
||||
def self.required_fields(klass)
|
||||
[:remember_created_at, :remember_token]
|
||||
end
|
||||
|
||||
# Generate a new remember token and save the record without validations
|
||||
# unless remember_across_browsers is true and the user already has a valid token.
|
||||
def remember_me!(extend_period=false)
|
||||
|
|
|
@ -155,4 +155,11 @@ class RememberMeTest < ActionController::IntegrationTest
|
|||
get users_path
|
||||
assert_not warden.authenticated?(:user)
|
||||
end
|
||||
|
||||
test 'required_fields should contain the fields that Devise uses' do
|
||||
assert_equal Devise::Models::Rememberable.required_fields(User), [
|
||||
:remember_created_at,
|
||||
:remember_token
|
||||
]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue