class ActionController::Parameters

def deep_dup

Returns a duplicate +ActionController::Parameters+ instance with the same permitted parameters.
def deep_dup
  self.class.new(@parameters.deep_dup, @logging_context).tap do |duplicate|
    duplicate.permitted = @permitted
  end
end