Class: Katello::DockerTag

Inherits:
Model
  • Object
show all
Includes:
ScopedSearchExtensions
Defined in:
app/models/katello/docker_tag.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#destroy!

Class Method Details

.completer_scope_optionsObject



49
50
51
# File 'app/models/katello/docker_tag.rb', line 49

def self.completer_scope_options
  {"#{Katello::Repository.table_name}" => lambda { |repo_class| repo_class.docker_type } }
end

.groupedObject



20
21
22
23
24
# File 'app/models/katello/docker_tag.rb', line 20

def self.grouped
  grouped_fields = "#{table_name}.name, #{Repository.table_name}.name, #{Product.table_name}.name"
  ids = uniq.select("ON (#{grouped_fields}) #{table_name}.id").joins(:repository => :product)
  where(:id => ids)
end

.with_identifiers(ids) ⇒ Object



45
46
47
# File 'app/models/katello/docker_tag.rb', line 45

def self.with_identifiers(ids)
  self.where(:id => ids)
end

.with_uuid(uuid) ⇒ Object

docker tag doesn’t have a uuid in pulp



27
28
29
# File 'app/models/katello/docker_tag.rb', line 27

def self.with_uuid(uuid)
  where(:id => uuid)
end

Instance Method Details

#full_nameObject



36
37
38
# File 'app/models/katello/docker_tag.rb', line 36

def full_name
  "#{repository.name}:#{name}"
end


40
41
42
43
# File 'app/models/katello/docker_tag.rb', line 40

def related_tags
  # tags in the same repo group with the same name
  self.class.where(:repository_id => repository.group, :name => name)
end

#repositoriesObject

docker tag only has one repo



32
33
34
# File 'app/models/katello/docker_tag.rb', line 32

def repositories
  [repository]
end