Sha256: a1d9238f0c0118ba34e88156cae4375e90356d8d5607a03264be4ec72534cae0

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

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

    has_many :repository_ostree_branches, :dependent => :destroy, :class_name => 'Katello::RepositoryOstreeBranch'
    has_many :repositories, :through => :repository_ostree_branches, :inverse_of => :ostree_branches

    scoped_search :on => :name, :complete_value => true
    scoped_search :on => :version, :complete_value => true
    scoped_search :on => :commit, :complete_value => true
    scoped_search :on => :pulp_id, :complete_value => true, :rename => :uuid
    scoped_search :on => :version_date, :complete_value => true, :rename => :created

    CONTENT_TYPE = Pulp::OstreeBranch::CONTENT_TYPE

    def self.repository_association_class
      RepositoryOstreeBranch
    end

    def update_from_json(json)
      update_attributes(:name => json[:branch],
                        :version => json[:metadata][:version],
                        :commit => json[:commit],
                        :version_date => json[:_created].to_datetime
                       )
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
katello-3.11.0 app/models/katello/ostree_branch.rb
katello-3.11.0.rc2 app/models/katello/ostree_branch.rb
katello-3.11.0.rc1 app/models/katello/ostree_branch.rb