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
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/integrations/field.rb')
-rw-r--r--app/models/integrations/field.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/integrations/field.rb b/app/models/integrations/field.rb
index ca7833c1a56..cbda418755b 100644
--- a/app/models/integrations/field.rb
+++ b/app/models/integrations/field.rb
@@ -13,10 +13,11 @@ module Integrations
exposes_secrets
].freeze
- attr_reader :name
+ attr_reader :name, :integration_class
- def initialize(name:, type: 'text', api_only: false, **attributes)
+ def initialize(name:, integration_class:, type: 'text', api_only: false, **attributes)
@name = name.to_s.freeze
+ @integration_class = integration_class
attributes[:type] = SECRET_NAME.match?(@name) ? 'password' : type
attributes[:api_only] = api_only
@@ -27,7 +28,7 @@ module Integrations
return name if key == :name
value = @attributes[key]
- return value.call if value.respond_to?(:call)
+ return integration_class.class_exec(&value) if value.respond_to?(:call)
value
end