diff options
-rw-r--r-- | app/models/ci/build.rb | 5 | ||||
-rw-r--r-- | app/models/ci/build/eraseable.rb | 15 | ||||
-rw-r--r-- | app/models/concerns/compoundable.rb | 19 | ||||
-rw-r--r-- | lib/gitlab/ci/build/eraseable.rb | 25 |
4 files changed, 17 insertions, 47 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index a421aa64658..ff100a31e7c 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -35,10 +35,9 @@ module Ci class Build < CommitStatus - include Compoundable - component :eraseable, Gitlab::Ci::Build::Eraseable - include Gitlab::Application.routes.url_helpers + include Eraseable + LAZY_ATTRIBUTES = ['trace'] belongs_to :runner, class_name: 'Ci::Runner' diff --git a/app/models/ci/build/eraseable.rb b/app/models/ci/build/eraseable.rb new file mode 100644 index 00000000000..bc427b112ec --- /dev/null +++ b/app/models/ci/build/eraseable.rb @@ -0,0 +1,15 @@ +module Ci + class Build + module Eraseable + include ActiveSupport::Concern + + def erase! + raise NotImplementedError + end + + def erased? + raise NotImpementedError + end + end + end +end diff --git a/app/models/concerns/compoundable.rb b/app/models/concerns/compoundable.rb deleted file mode 100644 index 0cef53a1027..00000000000 --- a/app/models/concerns/compoundable.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Compoundable - extend ActiveSupport::Concern - - class_methods do - private - - def component(name, klass) - define_method(name) do - component_object = instance_variable_get("@#{name}") - return component_object if component_object - instance_variable_set("@#{name}", klass.new(self)) - end - - klass.instance_methods(false).each do |method| - delegate method, to: name - end - end - end -end diff --git a/lib/gitlab/ci/build/eraseable.rb b/lib/gitlab/ci/build/eraseable.rb deleted file mode 100644 index b7dbc9fb1a9..00000000000 --- a/lib/gitlab/ci/build/eraseable.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Gitlab - module Ci - module Build - class Eraseable - def initialize(build) - @build = build - end - - def erase! - raise NotImplementedError - end - - def erased? - @build.artifacts_file.exists? && @build.artifacts_metadata.exists? - end - - private - - def trace_file - raise NotImplementedError - end - end - end - end -end |