Skip to content

Commit

Permalink
Merge pull request #17683 from kbrock/bz_total_vms
Browse files Browse the repository at this point in the history
Network Subnet total_vms work correctly
  • Loading branch information
bdunne authored Jul 10, 2018
2 parents 97c51f3 + f0a3dd5 commit a9ec5d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/cloud_subnet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CloudSubnet < ApplicationRecord

has_many :cloud_subnet_network_ports, :dependent => :destroy
has_many :network_ports, :through => :cloud_subnet_network_ports, :dependent => :destroy
has_many :vms, :through => :network_ports, :source => :device, :source_type => 'VmOrTemplate'
has_many :vms, -> { distinct }, :through => :network_ports, :source => :device, :source_type => 'VmOrTemplate'
has_many :cloud_subnets, :foreign_key => :parent_cloud_subnet_id

has_one :public_network, :through => :network_router, :source => :cloud_network
Expand Down

0 comments on commit a9ec5d3

Please sign in to comment.