Sha256: d25d91e353d8cd2b62f76a515d1702fcbbf0c2651f1ae4229bff826f39861c69

Contents?: true

Size: 1.02 KB

Versions: 29

Compression:

Stored size: 1.02 KB

Contents

module Katello
  module Concerns
    module DockerContainerWizardStateImageExtensions
      extend ActiveSupport::Concern

      module Overrides
        def image_exists
          return true if katello?
          super
        end
      end

      included do
        prepend Overrides

        serialize :katello_content, Hash
        validate :katello_content_completed, :if => :katello?
      end

      def katello_content_completed
        empty_values = katello_content.map do |key, value|
          key if value.blank?
        end
        empty_values.compact!

        return true if empty_values.empty?

        message_mapping = {
          organization_id: _("Organization not set"),
          environment_id: _("Lifecycle Environment not set"),
          content_view_id: _("Content View not set"),
          repository_id: _("Repository not set"),
          tag_id: _("Tag not set")
        }
        empty_values.each do |key|
          errors.add(:katello_content, message_mapping[key])
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
katello-3.11.2 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.10.2 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.10.1.1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.10.1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.11.1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.11.0 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.11.0.rc2 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.11.0.rc1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.10.0 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.10.0.rc1.1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.9.1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.10.0.rc1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.9.0 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.8.1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.9.0.rc2 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.9.0.rc1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.7.1.1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.7.1 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.8.0 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb
katello-3.8.0.rc3 app/models/katello/concerns/docker_container_wizard_state_image_extensions.rb