Skip to content

Commit 7779e63

Browse files
committed
remove useless conditional
Since we proved that `element` is always of type `Parameter`, we know that it will always respond to `permit`, so lets remove this conditional
1 parent 4129196 commit 7779e63

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

actionpack/lib/action_controller/metal/strong_parameters.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,6 @@ def hash_filter(params, filter)
666666
# Declaration { user: :name } or { user: [:name, :age, { address: ... }] }.
667667
params[key] = each_element(value) do |element|
668668
if element.is_a?(Parameters)
669-
element = self.class.new(element) unless element.respond_to?(:permit)
670669
element.permit(*Array.wrap(filter[key]))
671670
end
672671
end

0 commit comments

Comments
 (0)