Browse files

Session LazyHash#inspect triggers the hash to load

  • Loading branch information...
1 parent acd0612 commit 5fbacde2afc8ce25a65fdd084166d76c23c969c3 @josh josh committed Feb 7, 2009
Showing with 5 additions and 0 deletions.
  1. +5 −0 actionpack/lib/action_controller/session/abstract_store.rb
View
5 actionpack/lib/action_controller/session/abstract_store.rb
@@ -47,6 +47,11 @@ def data
to_hash
end
+ def inspect
+ load! unless @loaded
+ super
+ end
+
private
def loaded?
@loaded

2 comments on commit 5fbacde

@smtlaissezfaire

What’s the purpose of this change?

I’ve been burned with a “feature” like this before, when I was inspecting a loading issue with an ActiveRecord association in the debugger.

@smtlaissezfaire

Also, where’s the test?

Please sign in to comment.