aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-04-06 12:43:49 -0400
committerGitHub <noreply@github.com>2018-04-06 12:43:49 -0400
commit162b1f5463f171be339bea659626bd315f75d630 (patch)
tree41af30fda9064fe8a349c171c019d98d1d2adec1
parent0a353a97869b2af256d4253533beeb38303cf753 (diff)
parent15331a2ac4113673d4948eda03e33d0d11d9f335 (diff)
downloadrails-162b1f5463f171be339bea659626bd315f75d630.tar.gz
rails-162b1f5463f171be339bea659626bd315f75d630.tar.bz2
rails-162b1f5463f171be339bea659626bd315f75d630.zip
Merge pull request #32480 from bogdanvlviv/add-changelog-about-dig-session-23864
Add changelog entry for #32446
-rw-r--r--actionpack/CHANGELOG.md4
-rw-r--r--actionpack/lib/action_dispatch/request/session.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index 9835733b17..76342f7108 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Add method `dig` to `session`.
+
+ *claudiob*, *Takumi Shotoku*
+
* Controller level `force_ssl` has been deprecated in favor of
`config.force_ssl`.
diff --git a/actionpack/lib/action_dispatch/request/session.rb b/actionpack/lib/action_dispatch/request/session.rb
index 2ff651fc31..bc5e0670e0 100644
--- a/actionpack/lib/action_dispatch/request/session.rb
+++ b/actionpack/lib/action_dispatch/request/session.rb
@@ -93,8 +93,8 @@ module ActionDispatch
@delegate[key.to_s]
end
- # Returns the nested value specified by the sequence of key, returning
- # nil if any intermediate step is nil.
+ # Returns the nested value specified by the sequence of keys, returning
+ # +nil+ if any intermediate step is +nil+.
def dig(*keys)
load_for_read!
keys = keys.map.with_index { |key, i| i.zero? ? key.to_s : key }