Skip to content

Commit 0cefc50

Browse files
Matthias Dellwegm-bucher
authored andcommitted
Add ErratumDebPackage
1 parent a7e84d6 commit 0cefc50

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

app/models/katello/erratum.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Erratum < Katello::Model
2020
has_many :dbts_bugs, :class_name => "Katello::ErratumDbtsBug", :dependent => :destroy, :inverse_of => :erratum
2121
has_many :cves, :class_name => "Katello::ErratumCve", :dependent => :destroy, :inverse_of => :erratum
2222
has_many :packages, :class_name => "Katello::ErratumPackage", :dependent => :destroy, :inverse_of => :erratum
23+
has_many :deb_packages, :class_name => "Katello::ErratumDebPackage", :dependent => :destroy, :inverse_of => :erratum
2324

2425
scoped_search :on => :errata_id, :only_explicit => true
2526
scoped_search :on => :errata_id, :rename => :id, :complete_value => true, :only_explicit => true
@@ -35,6 +36,7 @@ class Erratum < Katello::Model
3536
scoped_search :relation => :dbts_bugs, :on => :bug_id, :rename => :bug
3637
scoped_search :relation => :packages, :on => :nvrea, :rename => :package, :complete_value => true
3738
scoped_search :relation => :packages, :on => :name, :rename => :package_name, :complete_value => true
39+
scoped_search :relation => :deb_packages, :on => :name, :rename => :package_name, :complete_value => true
3840

3941
before_save lambda { |erratum| erratum.title = erratum.title.truncate(255) unless erratum.title.blank? }
4042

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Katello
2+
class ErratumDebPackage < Katello::Model
3+
belongs_to :erratum, :inverse_of => :deb_packages, :class_name => 'Katello::Erratum'
4+
end
5+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class CreateKatelloErratumDebPackages < ActiveRecord::Migration[4.2]
2+
def change
3+
create_table :katello_erratum_deb_packages do |t|
4+
t.references :erratum
5+
t.string :name, limit: 255
6+
t.string :version, limit: 255
7+
t.string :filename, limit: 255
8+
t.string :release, limit: 255
9+
10+
t.timestamps
11+
end
12+
end
13+
end

0 commit comments

Comments
 (0)