Refactoring `expire_data_after_sign_out!`

This method is same to `expire_data_after_sign_in!`,
so alias it
This commit is contained in:
yui-knk 2015-06-03 13:14:18 +09:00
parent 2510c949e5
commit 3207c73d4b
1 changed files with 1 additions and 7 deletions

View File

@ -90,13 +90,7 @@ module Devise
session.keys.grep(/^devise\./).each { |k| session.delete(k) } session.keys.grep(/^devise\./).each { |k| session.delete(k) }
end end
def expire_data_after_sign_out! alias :expire_data_after_sign_out! :expire_data_after_sign_in!
# session.keys will return an empty array if the session is not yet loaded.
# This is a bug in both Rack and Rails.
# A call to #empty? forces the session to be loaded.
session.empty?
session.keys.grep(/^devise\./).each { |k| session.delete(k) }
end
end end
end end
end end