Sha256: d85b1de4d74152f316a71007ff4262f1365bcdff4ea4dee22374e83cb46772a0

Contents?: true

Size: 710 Bytes

Versions: 3

Compression:

Stored size: 710 Bytes

Contents

module RealmTheme
  extend ActiveSupport::Concern
  included do
    remove_const(:TYPES)
    const_set(:TYPES, ["Red Hat Identity Management", "Active Directory"])
    #removed validator that was using the old TYPES const
    Realm.class_eval do
      _validators.delete(:realm_type)
      _validate_callbacks.each do |callback|
        filter_method = callback.respond_to?(:raw_filter) ? :raw_filter : :filter
        if callback.send(filter_method).respond_to? :attributes
          callback.send(filter_method).attributes.delete :realm_type
        end
      end
      validates :realm_type, :presence => true, :inclusion => { :in => ["Red Hat Identity Management", "Active Directory"] }
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_theme_satellite-14.3.1 app/models/concerns/realm_theme.rb
foreman_theme_satellite-14.3.0 app/models/concerns/realm_theme.rb
foreman_theme_satellite-14.2.0 app/models/concerns/realm_theme.rb