aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-09-27 16:27:02 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2012-09-27 16:29:10 -0300
commit60f77cdb816df7c5a26dd24a2955430bc1f6bf41 (patch)
treed3e49ca6f7503c07c1a0ae088c6d9674d51a2a35
parent991cf78584450973f1c9345849b7415b179727aa (diff)
downloadrails-60f77cdb816df7c5a26dd24a2955430bc1f6bf41.tar.gz
rails-60f77cdb816df7c5a26dd24a2955430bc1f6bf41.tar.bz2
rails-60f77cdb816df7c5a26dd24a2955430bc1f6bf41.zip
Change key not found to param not found
-rw-r--r--actionpack/lib/action_controller/metal/strong_parameters.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index 55cc62a15e..7afa49a833 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -7,15 +7,15 @@ module ActionController
#
# params = ActionController::Parameters.new(a: {})
# params.fetch(:b)
- # # => ActionController::ParameterMissing: key not found: b
+ # # => ActionController::ParameterMissing: param not found: b
# params.require(:a)
- # # => ActionController::ParameterMissing: key not found: a
+ # # => ActionController::ParameterMissing: param not found: a
class ParameterMissing < KeyError
attr_reader :param # :nodoc:
def initialize(param) # :nodoc:
@param = param
- super("key not found: #{param}")
+ super("param not found: #{param}")
end
end
@@ -124,10 +124,10 @@ module ActionController
# # => {"name"=>"Francesco"}
#
# ActionController::Parameters.new(person: nil).require(:person)
- # # => ActionController::ParameterMissing: key not found: person
+ # # => ActionController::ParameterMissing: param not found: person
#
# ActionController::Parameters.new(person: {}).require(:person)
- # # => ActionController::ParameterMissing: key not found: person
+ # # => ActionController::ParameterMissing: param not found: person
def require(key)
self[key].presence || raise(ParameterMissing.new(key))
end
@@ -212,7 +212,7 @@ module ActionController
#
# params = ActionController::Parameters.new(person: { name: 'Francesco' })
# params.fetch(:person) # => {"name"=>"Francesco"}
- # params.fetch(:none) # => ActionController::ParameterMissing: key not found: none
+ # params.fetch(:none) # => ActionController::ParameterMissing: param not found: none
# params.fetch(:none, 'Francesco') # => "Francesco"
# params.fetch(:none) { 'Francesco' } # => "Francesco"
def fetch(key, *args)