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

25 lines
517 B
Ruby
Raw Normal View History

module Warden::Mixins::Common
def request
2010-01-14 09:47:14 -05:00
@request ||= env['action_controller.rescue.request']
end
def reset_session!
raw_session.inspect # why do I have to inspect it to get it to clear?
raw_session.clear
end
def response
2010-01-14 09:47:14 -05:00
@response ||= env['action_controller.rescue.response']
end
end
2010-01-14 07:38:02 -05:00
class Warden::SessionSerializer
def serialize(record)
[record.class, record.id]
end
def deserialize(keys)
klass, id = keys
klass.find(:first, :conditions => { :id => id })
end
end