Commit 325b2d93 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Remove legacy method from create build service

parent 6113ff99
......@@ -284,6 +284,9 @@ module Ci
end
end
##
# TODO, phase this method out
#
def config_builds_attributes
return [] unless config_processor
......
......@@ -23,6 +23,7 @@ module Ci
user: current_user,
trigger_request: trigger_request
)
build = pipeline.builds.create(build_attributes)
# Create the environment before the build starts. This sets its slug and
......@@ -34,17 +35,10 @@ module Ci
end
def new_builds
@new_builds ||= pipeline.config_builds_attributes.
reject { |build| existing_build_names.include?(build[:name]) }
end
def existing_build_names
@existing_build_names ||= pipeline.builds.pluck(:name)
@new_builds ||= pipeline.config_builds_attributes
end
def trigger_request
return @trigger_request if defined?(@trigger_request)
@trigger_request ||= pipeline.trigger_requests.first
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment