Sha256: 15a77aa8fad3b33245cfe6356cba6945fc3b72a3c9f5e383683b5aeeba47987a

Contents?: true

Size: 929 Bytes

Versions: 8

Compression:

Stored size: 929 Bytes

Contents

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

    CONTENT_TYPE = 'srpm'.freeze

    has_many :repository_srpms, :class_name => "Katello::RepositorySrpm", :dependent => :destroy, :inverse_of => :srpm
    has_many :repositories, :through => :repository_srpms, :class_name => "Katello::Repository"

    before_save lambda { |rpm| rpm.summary = rpm.summary.truncate(255) unless rpm.summary.blank? }

    def self.default_sort
      order(:name).order(:epoch).order(:version_sortable).order(:release_sortable)
    end

    def self.repository_association_class
      RepositorySrpm
    end

    def self.total_for_repositories(repos)
      self.in_repositories(repos).count
    end

    def nvrea
      Util::Package.build_nvrea(self.attributes.with_indifferent_access, false)
    end

    def build_nvra
      Util::Package.build_nvra(self.attributes.with_indifferent_access)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
katello-3.13.4 app/models/katello/srpm.rb
katello-3.13.3 app/models/katello/srpm.rb
katello-3.13.2 app/models/katello/srpm.rb
katello-3.13.1 app/models/katello/srpm.rb
katello-3.13.0 app/models/katello/srpm.rb
katello-3.13.0.rc2.1 app/models/katello/srpm.rb
katello-3.13.0.rc2 app/models/katello/srpm.rb
katello-3.13.0.rc1 app/models/katello/srpm.rb