Use Proc to infer available type attribute visibility

Otherwise, migrations will break when a plugin tries to register new
params.
pull/4322/head
Oliver Günther 9 years ago
parent 02ff24b3b2
commit b64aa048eb
  1. 11
      app/models/permitted_params.rb

@ -215,8 +215,9 @@ class PermittedParams
end
end
def type
params.require(:type).permit(*self.class.permitted_attributes[:type])
def type(args = {})
permitted = permitted_attributes(:type, args)
params.require(:type).permit(*permitted)
end
def type_move
@ -611,10 +612,12 @@ class PermittedParams
:is_milestone,
:is_default,
:color_id,
Proc.new do |args|
{ attribute_visibility: ::TypesHelper.work_package_form_attributes.keys }
end,
project_ids: [],
custom_field_ids: [],
attribute_visibility:
::TypesHelper.work_package_form_attributes.keys],
],
user: [
:firstname,
:lastname,

Loading…
Cancel
Save