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 }