Sha256: 53165de79b5f697cf91e9ec806dd1e00886c93c58219514f3b7c180db6388223

Contents?: true

Size: 831 Bytes

Versions: 14

Compression:

Stored size: 831 Bytes

Contents

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

    self.table_name = 'katello_files'

    CONTENT_TYPE = 'file'.freeze

    has_many :repository_files, :class_name => "Katello::RepositoryFile", :dependent => :destroy, :inverse_of => :file, :foreign_key => :file_id
    has_many :repositories, :through => :repository_files, :class_name => "Katello::Repository"

    scoped_search :on => :name, :complete_value => true
    scoped_search :on => :path, :complete_value => true
    scoped_search :on => :checksum

    def self.default_sort
      order(:name)
    end

    def self.repository_association_class
      RepositoryFile
    end

    def self.unit_id_field
      'file_id'
    end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
katello-3.13.4 app/models/katello/file_unit.rb
katello-3.13.3 app/models/katello/file_unit.rb
katello-3.13.2 app/models/katello/file_unit.rb
katello-3.13.1 app/models/katello/file_unit.rb
katello-3.13.0 app/models/katello/file_unit.rb
katello-3.13.0.rc2.1 app/models/katello/file_unit.rb
katello-3.13.0.rc2 app/models/katello/file_unit.rb
katello-3.12.3 app/models/katello/file_unit.rb
katello-3.12.2 app/models/katello/file_unit.rb
katello-3.13.0.rc1 app/models/katello/file_unit.rb
katello-3.12.1 app/models/katello/file_unit.rb
katello-3.12.0 app/models/katello/file_unit.rb
katello-3.12.0.rc2 app/models/katello/file_unit.rb
katello-3.12.0.rc1 app/models/katello/file_unit.rb