summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/concerns/issuable_actions.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb
index c925b4aada5..38accc9692b 100644
--- a/app/controllers/concerns/issuable_actions.rb
+++ b/app/controllers/concerns/issuable_actions.rb
@@ -7,6 +7,19 @@ module IssuableActions
before_action :authorize_admin_issuable!, only: :bulk_update
end
+ def permitted_keys
+ [
+ :issuable_ids,
+ :assignee_id,
+ :milestone_id,
+ :state_event,
+ :subscription_event,
+ label_ids: [],
+ add_label_ids: [],
+ remove_label_ids: []
+ ]
+ end
+
def show
respond_to do |format|
format.html
@@ -140,24 +153,15 @@ module IssuableActions
end
def bulk_update_params
- permitted_keys = [
- :issuable_ids,
- :assignee_id,
- :milestone_id,
- :state_event,
- :subscription_event,
- label_ids: [],
- add_label_ids: [],
- remove_label_ids: []
- ]
+ permitted_keys_array = permitted_keys.dup
if resource_name == 'issue'
- permitted_keys << { assignee_ids: [] }
+ permitted_keys_array << { assignee_ids: [] }
else
- permitted_keys.unshift(:assignee_id)
+ permitted_keys_array.unshift(:assignee_id)
end
- params.require(:update).permit(permitted_keys)
+ params.require(:update).permit(permitted_keys_array)
end
def resource_name