diff options
author | amitkumarsuroliya <amitkumarsuroliya@gmail.com> | 2015-10-11 02:40:29 +0530 |
---|---|---|
committer | amitkumarsuroliya <amitkumarsuroliya@gmail.com> | 2015-10-11 02:40:29 +0530 |
commit | aa37991e436fb4284a16c324ab5115d73784ff38 (patch) | |
tree | 74b4d72370361bdeca5d8f54836c73321e44310e | |
parent | 1d8d3b37c1bc759e0da8c24625ec0ea68c5d6d62 (diff) | |
download | rails-aa37991e436fb4284a16c324ab5115d73784ff38.tar.gz rails-aa37991e436fb4284a16c324ab5115d73784ff38.tar.bz2 rails-aa37991e436fb4284a16c324ab5115d73784ff38.zip |
Improved `KeyError` messages on bang version, since commit https://github.com/rails/rails/commit/e768c519fb6015e00961702a5165c6dab548a954 bang version produces `KeyError` [ci skip]
-rw-r--r-- | activesupport/lib/active_support/ordered_options.rb | 2 | ||||
-rw-r--r-- | guides/source/security.md | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb index 45864990ce..53a55bd986 100644 --- a/activesupport/lib/active_support/ordered_options.rb +++ b/activesupport/lib/active_support/ordered_options.rb @@ -20,7 +20,7 @@ module ActiveSupport # To raise an exception when the value is blank, append a # bang to the key name, like: # - # h.dog! # => raises KeyError + # h.dog! # => raises KeyError: key not found: :dog # class OrderedOptions < Hash alias_method :_get, :[] # preserve the original #[] method diff --git a/guides/source/security.md b/guides/source/security.md index 5a6ac9446a..1b74d17dd6 100644 --- a/guides/source/security.md +++ b/guides/source/security.md @@ -1048,7 +1048,7 @@ If you want an exception to be raised when some key is blank, use the bang version: ```ruby -Rails.application.secrets.some_api_key! # => raises KeyError +Rails.application.secrets.some_api_key! # => raises KeyError: key not found: :some_api_key ``` Additional Resources |