Skip to content

Commit

Permalink
Add inverse_of to VmOrTemplate and Host models
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Aug 7, 2018
1 parent de5896c commit ebe0b55
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 @@ -91,7 +91,7 @@ class Host < ApplicationRecord
:inverse_of => :host
has_many :host_aggregate_hosts, :dependent => :destroy
has_many :host_aggregates, :through => :host_aggregate_hosts
has_one :conversion_host, :as => :resource, :dependent => :destroy
has_one :conversion_host, :as => :resource, :dependent => :destroy, :inverse_of => :resource

# Physical server reference
belongs_to :physical_server, :inverse_of => :host
Expand Down
2 changes: 1 addition & 1 deletion app/models/vm_or_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class VmOrTemplate < ApplicationRecord
has_many :guest_applications, :dependent => :destroy
has_many :patches, :dependent => :destroy

has_one :conversion_host, :as => :resource, :dependent => :destroy
has_one :conversion_host, :as => :resource, :dependent => :destroy, :inverse_of => :resource

belongs_to :resource_group

Expand Down

0 comments on commit ebe0b55

Please sign in to comment.