Sha256: 3c6484c4bb4cae7b4ec51e1d2e9099da1a5dab2d092501d1062c6d035a9fe439
Contents?: true
Size: 1.04 KB
Versions: 72
Compression:
Stored size: 1.04 KB
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 after_commit :update_global_proxies end def recalculate_errata_status ForemanTasks.async_task(Actions::Katello::Host::RecalculateErrataStatus) if saved_change_to_attribute?(:value) && name == 'errata_status_installable' end def update_global_proxies if saved_change_to_attribute?(:value) && name == 'content_default_http_proxy' repos = RootRepository.with_global_proxy.collect(&:library_instance).uniq unless repos.empty? ForemanTasks.async_task( ::Actions::BulkAction, ::Actions::Katello::Repository::UpdateHttpProxyDetails, repos.sort_by(&:pulp_id)) end end end end end end
Version data entries
72 entries across 72 versions & 1 rubygems