Sha256: 292725a357382b4cc16bae7d309b8c8aec4aee17c17c3cd384c6b251d9e52dbe

Contents?: true

Size: 566 Bytes

Versions: 21

Compression:

Stored size: 566 Bytes

Contents

module Katello
  module Concerns
    module SettingExtensions
      extend ActiveSupport::Concern

      included do
        validates :value, inclusion: { in: ::Runcible::Models::YumImporter::DOWNLOAD_POLICIES },
          if: ->(setting) { setting.name == 'default_download_policy' }

        after_save :recalculate_errata_status
      end

      def recalculate_errata_status
        ForemanTasks.async_task(Actions::Katello::Host::RecalculateErrataStatus) if saved_change_to_attribute?(:value) && name == 'errata_status_installable'
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
katello-3.12.3 app/models/katello/concerns/setting_extensions.rb
katello-3.12.2 app/models/katello/concerns/setting_extensions.rb
katello-3.12.1 app/models/katello/concerns/setting_extensions.rb
katello-3.11.2 app/models/katello/concerns/setting_extensions.rb
katello-3.10.2 app/models/katello/concerns/setting_extensions.rb
katello-3.12.0 app/models/katello/concerns/setting_extensions.rb
katello-3.12.0.rc2 app/models/katello/concerns/setting_extensions.rb
katello-3.10.1.1 app/models/katello/concerns/setting_extensions.rb
katello-3.12.0.rc1 app/models/katello/concerns/setting_extensions.rb
katello-3.10.1 app/models/katello/concerns/setting_extensions.rb
katello-3.11.1 app/models/katello/concerns/setting_extensions.rb
katello-3.11.0 app/models/katello/concerns/setting_extensions.rb
katello-3.11.0.rc2 app/models/katello/concerns/setting_extensions.rb
katello-3.11.0.rc1 app/models/katello/concerns/setting_extensions.rb
katello-3.10.0 app/models/katello/concerns/setting_extensions.rb
katello-3.10.0.rc1.1 app/models/katello/concerns/setting_extensions.rb
katello-3.9.1 app/models/katello/concerns/setting_extensions.rb
katello-3.10.0.rc1 app/models/katello/concerns/setting_extensions.rb
katello-3.9.0 app/models/katello/concerns/setting_extensions.rb
katello-3.9.0.rc2 app/models/katello/concerns/setting_extensions.rb