Module: Integrations::EnableSslVerification

Extended by:
ActiveSupport::Concern
Included in:
Bamboo, DroneCi, Jenkins, MockCi, Teamcity
Defined in:
app/models/concerns/integrations/enable_ssl_verification.rb

Instance Method Summary collapse

Instance Method Details

#fieldsObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/models/concerns/integrations/enable_ssl_verification.rb', line 17

def fields
  super.tap do |fields|
    url_index = fields.index { |field| field[:name].ends_with?('_url') }
    insert_index = url_index ? url_index + 1 : -1

    fields.insert(insert_index,
      Field.new(
        name: 'enable_ssl_verification',
        integration_class: self,
        type: :checkbox,
        title: s_('Integrations|SSL verification'),
        checkbox_label: s_('Integrations|Enable SSL verification'),
        help: s_('Integrations|Clear if using a self-signed certificate.')
      )
    )
  end
end

#initialize_propertiesObject



11
12
13
14
15
# File 'app/models/concerns/integrations/enable_ssl_verification.rb', line 11

def initialize_properties
  super

  self.enable_ssl_verification = true if new_record? && enable_ssl_verification.nil?
end