Skip to content

Commit

Permalink
Merge pull request ManageIQ#15862 from aufi/add_openscap_result_to_vm
Browse files Browse the repository at this point in the history
Add Openscap Result to VM model
  • Loading branch information
blomquisg authored Sep 18, 2017
2 parents 5cdd4f3 + aceda57 commit c1549f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/openscap_result.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class OpenscapResult < ApplicationRecord
belongs_to :container_image
belongs_to :resource, :polymorphic => true
has_one :binary_blob, :dependent => :destroy, :autosave => true, :as => :resource, :required => true
has_many :openscap_rule_results, :dependent => :destroy, :autosave => true

Expand Down
2 changes: 2 additions & 0 deletions app/models/vm_or_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class VmOrTemplate < ApplicationRecord
has_many :storage_files, :dependent => :destroy
has_many :storage_files_files, -> { where("rsc_type = 'file'") }, :class_name => "StorageFile"

has_one :openscap_result, :as => :resource, :dependent => :destroy

# EMS Events
has_many :ems_events, ->(vmt) { where(["vm_or_template_id = ? OR dest_vm_or_template_id = ?", vmt.id, vmt.id]).order(:timestamp) },
:class_name => "EmsEvent"
Expand Down

0 comments on commit c1549f0

Please sign in to comment.