lib/devise/hooks/trackable.rb in devise-1.1.pre4 vs lib/devise/hooks/trackable.rb in devise-1.1.rc0
- old
+ new
@@ -1,7 +1,9 @@
# After each sign in, update sign in time, sign in count and sign in IP.
+# This is only triggered when the user is explicitly set (with set_user)
+# and on authentication. Retrieving the user from session (:fetch) does
+# not trigger it.
Warden::Manager.after_set_user :except => :fetch do |record, warden, options|
- scope = options[:scope]
- if record.respond_to?(:update_tracked_fields!) && warden.authenticated?(scope)
+ if record.respond_to?(:update_tracked_fields!) && warden.authenticated?(options[:scope])
record.update_tracked_fields!(warden.request)
end
end