File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,10 +125,12 @@ def copy_activated_custom_fields(call)
125125 # This has to run after copy_activated_custom_fields, since that is what
126126 # actually creates most of the mappings being adjusted here.
127127 def copy_creation_wizard_flags ( project )
128- enabled_cf_ids = source . project_custom_field_project_mappings . where ( creation_wizard : true ) . pluck ( :custom_field_id )
128+ source_flags = source . project_custom_field_project_mappings . pluck ( :custom_field_id , :creation_wizard ) . to_h
129129
130- project . project_custom_field_project_mappings . update_all ( creation_wizard : false )
131- project . project_custom_field_project_mappings . where ( custom_field_id : enabled_cf_ids ) . update_all ( creation_wizard : true )
130+ project . project_custom_field_project_mappings . find_each do |mapping |
131+ creation_wizard = source_flags [ mapping . custom_field_id ]
132+ mapping . update_column ( :creation_wizard , creation_wizard ) unless creation_wizard . nil?
133+ end
132134 end
133135
134136 def retain_attributes ( source , target )
You can’t perform that action at this time.
0 commit comments