Permalink
Browse files

Fixed session to xml inspector for Rails4 ActionDispatch Session.

  • Loading branch information...
1 parent 3c12f7c commit e3eea801de3321b8cb0235b459924a9c21f7b73c @hotchpotch hotchpotch committed Mar 7, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/rack_session_access/middleware.rb
@@ -51,7 +51,12 @@ def show(request)
render do |xml|
xml.h2 "Rack session data"
xml.ul do |xml|
- request.env[@key].each do |k,v|
+ session = request.env[@key]
+ if session.respond_to?(:to_hash)
+ # session is ActionDispatch::Request::Session
+ session = session.to_hash
+ end
+ session.each do |k,v|
xml.li("#{k.inspect} : #{v.inspect}")
end
end

0 comments on commit e3eea80

Please sign in to comment.