Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-29 11:43:46 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-02-19 19:24:03 +0300
commitf6a91ccc5b21d26c677bf828fa255f16f453e1e0 (patch)
tree521d7f457c0fb607b9790c7f01b8ab27869c7558 /app
parent9972abc2951e2d2c7c4c94189199234c39d25ceb (diff)
Move eraseable implementation to build concern
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb5
-rw-r--r--app/models/ci/build/eraseable.rb15
-rw-r--r--app/models/concerns/compoundable.rb19
3 files changed, 17 insertions, 22 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