WIP: Testing raising an error on IssuableFinder invalid params
Just a CI test, to see where we pass in invalid params from
Merge request reports
Activity
146 146 end 147 147 148 148 def export_csv 149 csv_params = filter_params.permit(IssuableFinder::VALID_PARAMS) 149 csv_params = IssuableFinder.valid_params(filter_params) you can have a method here called
csv_params
and call that in the view with @csv_params or a helper....Edited by James Lopez
21 21 class IssuableFinder 22 22 NONE = '0'.freeze 23 23 VALID_PARAMS = %i(scope state group_id project_id milestone_title assignee_id search label_name sort assignee_username author_id author_username authorized_only due_date iids non_archived weight).freeze What about bringing
SCALAR_PARAMS
back and removingself.valid_params
that way...VALID_PARAMS = SCALAR_PARAMS + ARRAY_PARAMS
and with my comment https://gitlab.com/gitlab-org/gitlab-ee/commit/64ec68f605a411eb5a93832b42caadd8b22beecb#note_25599346 would make the change very simple... Wdyt?
This suggestion would work if it weren't for
permit
wantingARRAY_PARAMS
as a hash.I misnamed it because I misread the docs which said:
To declare that the value in params must be an array of permitted scalar values map the key to an empty array
yep, or extract it into a method...
👍 Edited by James Lopez
mentioned in merge request !1444 (merged)