From 3498aacbbebb41e529b6755f4ccfdfbb84c28830 Mon Sep 17 00:00:00 2001 From: codeforkjeff Date: Wed, 26 Apr 2017 18:48:41 -0400 Subject: Add lazy loading to #keys and #values methods in Session This fixes a bug where session.keys and session.values return an empty array unless one of the other methods that does lazy loading from the underlying store is called first. #keys and #values should also call #load_for_read! --- actionpack/lib/action_dispatch/request/session.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/request/session.rb b/actionpack/lib/action_dispatch/request/session.rb index 74ba6466cf..3547a8604f 100644 --- a/actionpack/lib/action_dispatch/request/session.rb +++ b/actionpack/lib/action_dispatch/request/session.rb @@ -101,11 +101,13 @@ module ActionDispatch # Returns keys of the session as Array. def keys + load_for_read! @delegate.keys end # Returns values of the session as Array. def values + load_for_read! @delegate.values end -- cgit v1.2.3