Skip to content

Commit 60f77cd

Browse files
committed
Change key not found to param not found
1 parent 991cf78 commit 60f77cd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

actionpack/lib/action_controller/metal/strong_parameters.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ module ActionController
77
#
88
# params = ActionController::Parameters.new(a: {})
99
# params.fetch(:b)
10-
# # => ActionController::ParameterMissing: key not found: b
10+
# # => ActionController::ParameterMissing: param not found: b
1111
# params.require(:a)
12-
# # => ActionController::ParameterMissing: key not found: a
12+
# # => ActionController::ParameterMissing: param not found: a
1313
class ParameterMissing < KeyError
1414
attr_reader :param # :nodoc:
1515

1616
def initialize(param) # :nodoc:
1717
@param = param
18-
super("key not found: #{param}")
18+
super("param not found: #{param}")
1919
end
2020
end
2121

@@ -124,10 +124,10 @@ def permit!
124124
# # => {"name"=>"Francesco"}
125125
#
126126
# ActionController::Parameters.new(person: nil).require(:person)
127-
# # => ActionController::ParameterMissing: key not found: person
127+
# # => ActionController::ParameterMissing: param not found: person
128128
#
129129
# ActionController::Parameters.new(person: {}).require(:person)
130-
# # => ActionController::ParameterMissing: key not found: person
130+
# # => ActionController::ParameterMissing: param not found: person
131131
def require(key)
132132
self[key].presence || raise(ParameterMissing.new(key))
133133
end
@@ -212,7 +212,7 @@ def [](key)
212212
#
213213
# params = ActionController::Parameters.new(person: { name: 'Francesco' })
214214
# params.fetch(:person) # => {"name"=>"Francesco"}
215-
# params.fetch(:none) # => ActionController::ParameterMissing: key not found: none
215+
# params.fetch(:none) # => ActionController::ParameterMissing: param not found: none
216216
# params.fetch(:none, 'Francesco') # => "Francesco"
217217
# params.fetch(:none) { 'Francesco' } # => "Francesco"
218218
def fetch(key, *args)

0 commit comments

Comments
 (0)