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
2010-01-14 15:47:14 +01:00

25 lines
No EOL
517 B
Ruby

module Warden::Mixins::Common
def request
@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
@response ||= env['action_controller.rescue.response']
end
end
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