Skip to content

Add cop prohibiting params argument in url_for

Jarka Košanová requested to merge 47986-rubocop-safe-params into master

What does this MR do?

It adds a new cop that restricts using param as an argument in url_for method.

It only checks if this argument is present in the method calling. If a param is processed before, no offense is found

Example, that will pass rubocop:

url_params = params.merge(add: 1)
url_for(url_params)

Open to discussion how strict this cop should be

What are the relevant issue numbers?

Closes #47986 (closed)

Does this MR meet the acceptance criteria?

/cc @smcgivern

Merge request reports