Skip to content

Commit cdae622

Browse files
committed
Allow setting CopyService contract_options: param
1 parent 7ffc403 commit cdae622

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/services/projects/copy_service.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ def self.copyable_dependencies
5959
count_source: ->(source, _) { source.work_packages.joins(:file_links).count("file_links.id") } }]
6060
end
6161

62+
def initialize(contract_options: {}, **)
63+
super(contract_options: contract_options.reverse_merge(validate_model: true), **)
64+
end
65+
6266
protected
6367

6468
##
@@ -102,10 +106,6 @@ def copy_activated_custom_fields(call)
102106
call.result.project_custom_field_ids = source.project_custom_field_ids
103107
end
104108

105-
def contract_options
106-
{ copy_source: source, validate_model: true }
107-
end
108-
109109
def retain_attributes(source, target)
110110
# Ensure we keep the public value of the source project
111111
# which might get overridden by the SetAttributesService

0 commit comments

Comments
 (0)