Skip to content

Commit

Permalink
Add changelog entry for #32446
Browse files Browse the repository at this point in the history
In #32446 was added method `dig` to `session`.
Improve docs of method `dig`.

[ci skip]
  • Loading branch information
bogdanvlviv committed Apr 6, 2018
1 parent 475a291 commit 15331a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions 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`.

Expand Down
4 changes: 2 additions & 2 deletions actionpack/lib/action_dispatch/request/session.rb
Expand Up @@ -93,8 +93,8 @@ def [](key)
@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 }
Expand Down

0 comments on commit 15331a2

Please sign in to comment.