Sha256: a8be0361db49f90da41754e4d97317d37cbcac797fbdc2cafc5f8dafb075969a

Contents?: true

Size: 457 Bytes

Versions: 2

Compression:

Stored size: 457 Bytes

Contents

class Setting
  class HostValidation < ::Setting
    def self.load_defaults
      return unless ActiveRecord::Base.connection.table_exists?('settings')
      return unless super

      Setting.transaction do
        [
          set('host_name_validation_regex', _('Default regex the name of a host is validated against'), '^[a-zA-Z0-9-_]+$')
        ].compact.each { |s| create s.update(:category => 'Setting::HostValidation') }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_host_extra_validator-0.0.1 app/models/setting/foreman_host_extra_validator.rb
foreman_host_extra_validator-0.0.2 app/models/setting/foreman_host_extra_validator.rb