summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-13 14:12:00 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-13 14:12:00 +0100
commite16fba6726adcf7e82862336fab22c6c6baf2010 (patch)
treee4fc892dfa5e06cf4f5e8852b22663f3b091ebbe /lib
parent937e7f9e9669d4939cd6c5055a90339ff79d216b (diff)
downloadgitlab-ce-e16fba6726adcf7e82862336fab22c6c6baf2010.tar.gz
Improve how we handle persistent runner variables
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/variables/collection/item.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/gitlab/ci/variables/collection/item.rb b/lib/gitlab/ci/variables/collection/item.rb
index 47e06566607..939912981e6 100644
--- a/lib/gitlab/ci/variables/collection/item.rb
+++ b/lib/gitlab/ci/variables/collection/item.rb
@@ -3,8 +3,6 @@ module Gitlab
module Variables
class Collection
class Item
- # TODO, public by default?
- #
def initialize(**options)
@variable = {
key: options.fetch(:key),
@@ -34,17 +32,11 @@ module Gitlab
end
def self.fabricate(resource)
- # TODO, to_runner_variable by default for class < ActiveRecord::Base
- #
case resource
when Hash
self.new(resource)
- when ::Ci::Variable
- self.new(resource.to_hash)
- when ::Ci::PipelineVariable
- self.new(resource.to_hash)
- when ::Ci::GroupVariable
- self.new(resource.to_hash)
+ when ::HasVariable
+ self.new(resource.to_runner_variable)
when self
resource.dup
else