Created
October 2, 2013 18:41
-
-
Save gvt/6798494 to your computer and use it in GitHub Desktop.
Authlogic::Session::MagicColumns::InstanceMethods#update_info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update_info | |
record.login_count = (record.login_count.blank? ? 1 : record.login_count + 1) if record.respond_to?(:login_count) | |
record.failed_login_count = 0 if record.respond_to?(:failed_login_count) | |
if record.respond_to?(:current_login_at) | |
record.last_login_at = record.current_login_at if record.respond_to?(:last_login_at) | |
record.current_login_at = klass.default_timezone == :utc ? Time.now.utc : Time.now | |
end | |
if record.respond_to?(:current_login_ip) | |
record.last_login_ip = record.current_login_ip if record.respond_to?(:last_login_ip) | |
record.current_login_ip = controller.request.remote_ip | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment