diff options
author | Manoj M J <manojmj92@gmail.com> | 2017-09-20 13:08:00 +0530 |
---|---|---|
committer | Manoj M J <manojmj92@gmail.com> | 2017-09-20 13:08:00 +0530 |
commit | 80f46653e2353a40a7175cbd6030dcf60916d6cd (patch) | |
tree | bf8488c1cc65162cc0e0db49b9c02de2c0f73592 /activesupport/lib/active_support | |
parent | 34956f7422798f27f8926544d58771042f6f1c3a (diff) | |
download | rails-80f46653e2353a40a7175cbd6030dcf60916d6cd.tar.gz rails-80f46653e2353a40a7175cbd6030dcf60916d6cd.tar.bz2 rails-80f46653e2353a40a7175cbd6030dcf60916d6cd.zip |
Fix error message documentation
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/ordered_options.rb | 4 |
1 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 fa7825b3ba..c2a37fbdd7 100644 --- a/activesupport/lib/active_support/ordered_options.rb +++ b/activesupport/lib/active_support/ordered_options.rb @@ -24,7 +24,7 @@ module ActiveSupport # To raise an exception when the value is blank, append a # bang to the key name, like: # - # h.dog! # => raises KeyError: key not found: :dog + # h.dog! # => raises KeyError: :dog is blank # class OrderedOptions < Hash alias_method :_get, :[] # preserve the original #[] method @@ -46,7 +46,7 @@ module ActiveSupport bangs = name_string.chomp!("!") if bangs - fetch(name_string.to_sym).presence || raise(KeyError.new("#{name_string} is blank.")) + fetch(name_string.to_sym).presence || raise(KeyError.new(":#{name_string} is blank")) else self[name_string] end |