Sha256: c9c1639fd19934e5d2c4f33f4490e5ba26289819c28e422ba9510244ec8e8731

Contents?: true

Size: 1.27 KB

Versions: 5

Compression:

Stored size: 1.27 KB

Contents

module Katello
  class DockerManifest < Katello::Model
    include Concerns::PulpDatabaseUnit

    has_many :docker_tags, :dependent => :destroy, :class_name => "Katello::DockerTag", :foreign_key => :docker_manifest_id
    has_many :repository_docker_manifests, :dependent => :destroy
    has_many :repositories, :through => :repository_docker_manifests, :inverse_of => :docker_manifests

    CONTENT_TYPE = Pulp::DockerManifest::CONTENT_TYPE
    scoped_search :on => :name, :complete_value => true
    scoped_search :relation => :docker_tags, :on => :name, :rename => :tag, :complete_value => true, :only_explicit => true
    scoped_search :on => :digest, :rename => :digest, :complete_value => true, :only_explicit => true
    scoped_search :on => :schema_version, :rename => :schema_version, :complete_value => true, :only_explicit => true

    def self.repository_association_class
      RepositoryDockerManifest
    end

    def update_from_json(json)
      update_attributes(:name => json[:name],
                        :schema_version => json[:schema_version],
                        :digest => json[:digest],
                        :downloaded => json[:downloaded]
                       )
    end

    def self.default_sort
      order(:name).order(:schema_version)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
katello-3.5.2 app/models/katello/docker_manifest.rb
katello-3.5.1.1 app/models/katello/docker_manifest.rb
katello-3.5.1 app/models/katello/docker_manifest.rb
katello-3.5.0.1 app/models/katello/docker_manifest.rb
katello-3.5.0 app/models/katello/docker_manifest.rb