mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Merge pull request #2444 from julp/no_ghost_transactions
Fix empty transactions created by devise
This commit is contained in:
commit
2ead747be6
2 changed files with 2 additions and 2 deletions
|
@ -2,6 +2,6 @@
|
|||
# This is only triggered when the user is explicitly set (with set_user)
|
||||
Warden::Manager.after_set_user :except => :fetch do |record, warden, options|
|
||||
if record.respond_to?(:failed_attempts) && warden.authenticated?(options[:scope])
|
||||
record.update_attribute(:failed_attempts, 0)
|
||||
record.update_attribute(:failed_attempts, 0) unless record.failed_attempts.zero?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -50,7 +50,7 @@ module Devise
|
|||
def remember_me!(extend_period=false)
|
||||
self.remember_token = self.class.remember_token if generate_remember_token?
|
||||
self.remember_created_at = Time.now.utc if generate_remember_timestamp?(extend_period)
|
||||
save(:validate => false)
|
||||
save(:validate => false) if self.changed?
|
||||
end
|
||||
|
||||
# If the record is persisted, remove the remember token (but only if
|
||||
|
|
Loading…
Reference in a new issue