Create custom field by copy (#34307).

Patch by Takenori TAKAKI.


git-svn-id: http://svn.redmine.org/redmine/trunk@20692 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2020-12-26 01:36:19 +00:00
parent 46156e08a9
commit 972f00eb47
6 changed files with 147 additions and 0 deletions

View File

@@ -98,6 +98,9 @@ class CustomFieldsController < ApplicationController
if @custom_field.nil?
render :action => 'select_type'
else
if params[:copy].present? && (@copy_from = CustomField.find_by(id: params[:copy]))
@custom_field.copy_from(@copy_from)
end
@custom_field.safe_attributes = params[:custom_field]
end
end