Add changelog entry for #32446

In #32446 was added method `dig` to `session`.
Improve docs of method `dig`.

[ci skip]
This commit is contained in:
bogdanvlviv 2018-04-06 15:02:44 +03:00
parent 475a2911bb
commit 15331a2ac4
No known key found for this signature in database
GPG Key ID: E4ACD76A6DB6DFDD
2 changed files with 6 additions and 2 deletions

View File

@ -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`.

View File

@ -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 }