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

added non-bang version of update_tracked_fields

This commit is contained in:
Kush Kella 2014-05-21 16:18:35 -07:00
parent 2f6edfd0c5
commit 451be888cb

View file

@ -15,7 +15,7 @@ module Devise
[:current_sign_in_at, :current_sign_in_ip, :last_sign_in_at, :last_sign_in_ip, :sign_in_count]
end
def update_tracked_fields!(request)
def update_tracked_fields(request)
old_current, new_current = self.current_sign_in_at, Time.now.utc
self.last_sign_in_at = old_current || new_current
self.current_sign_in_at = new_current
@ -26,7 +26,10 @@ module Devise
self.sign_in_count ||= 0
self.sign_in_count += 1
end
def update_tracked_fields!(request)
update_tracked_fields(request)
save(validate: false) or raise "Devise trackable could not save #{inspect}." \
"Please make sure a model using trackable can be saved at sign in."
end