Skip to content

Commit

Permalink
Merge pull request #16440 from Ladas/missing_cascade_delete_for_host_…
Browse files Browse the repository at this point in the history
…storages

Missing cascade delete for host_storages
  • Loading branch information
agrare authored Nov 13, 2017
2 parents 66a5465 + 85c0224 commit b872a1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Host < ApplicationRecord
has_many :vms_and_templates, :dependent => :nullify
has_many :vms, :inverse_of => :host
has_many :miq_templates, :inverse_of => :host
has_many :host_storages
has_many :host_storages, :dependent => :destroy
has_many :storages, :through => :host_storages
has_many :host_switches, :dependent => :destroy
has_many :switches, :through => :host_switches
Expand Down
2 changes: 1 addition & 1 deletion app/models/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Storage < ApplicationRecord
has_many :vms_and_templates, :foreign_key => :storage_id, :dependent => :nullify, :class_name => "VmOrTemplate"
has_many :miq_templates, :foreign_key => :storage_id
has_many :vms, :foreign_key => :storage_id
has_many :host_storages
has_many :host_storages, :dependent => :destroy
has_many :hosts, :through => :host_storages
has_many :storage_profile_storages, :dependent => :destroy
has_many :storage_profiles, :through => :storage_profile_storages
Expand Down

0 comments on commit b872a1f

Please sign in to comment.