Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply distinct on lans and switches #15930

Merged
merged 1 commit into from
Sep 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions app/models/manageiq/providers/infra_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ class InfraManager < BaseManager

include AvailabilityMixin

has_many :host_hardwares, :through => :hosts, :source => :hardware
has_many :host_operating_systems, :through => :hosts, :source => :operating_system
has_many :host_storages, :through => :hosts
has_many :host_switches, :through => :hosts
has_many :host_networks, :through => :hosts, :source => :networks
has_many :snapshots, :through => :vms_and_templates
has_many :operating_systems, :through => :vms_and_templates
has_many :switches, :through => :hosts
has_many :lans, :through => :hosts
has_many :networks, :through => :hardwares
has_many :guest_devices, :through => :hardwares
has_many :host_hardwares, :through => :hosts, :source => :hardware
has_many :host_operating_systems, :through => :hosts, :source => :operating_system
has_many :host_storages, :through => :hosts
has_many :host_switches, :through => :hosts
has_many :host_networks, :through => :hosts, :source => :networks
has_many :snapshots, :through => :vms_and_templates
has_many :operating_systems, :through => :vms_and_templates
has_many :switches, -> { distinct }, :through => :hosts
has_many :lans, -> { distinct }, :through => :hosts
has_many :networks, :through => :hardwares
has_many :guest_devices, :through => :hardwares

class << model_name
define_method(:route_key) { "ems_infras" }
Expand Down