1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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 }