Skip to content

Instantly share code, notes, and snippets.

@tomchapin
Created May 28, 2013 21:15
Show Gist options
  • Save tomchapin/5666208 to your computer and use it in GitHub Desktop.
Save tomchapin/5666208 to your computer and use it in GitHub Desktop.
Session Debugger (put in application_controller.rb). Courtesy of Jason Waldrip.
def session_with_debug
SessionDebugger.new(session_without_debug)
end
alias_method_chain :session, :debug
class SessionDebugger < SimpleDelegator
def []=(key, val)
puts "#{caller.first} SET session:#{key} TO #{val.inspect}"
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment