-
Notifications
You must be signed in to change notification settings - Fork 897
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
Fix ordering by VMs in NetworkManagers list #14092
Fix ordering by VMs in NetworkManagers list #14092
Conversation
Fix ordering by VMs in NetworkManagers list Fixes BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1383307
5b86dff
to
5c835d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good.
just the 1 comment and the code change
@@ -25,6 +25,21 @@ class << model_name | |||
has_many :load_balancer_health_checks, :foreign_key => :ems_id, :dependent => :destroy | |||
has_many :load_balancer_health_check_members, :through => :load_balancer_health_checks | |||
|
|||
# Generates ORDER BY ((SELECT COUNT(*) FROM "vms" WHERE "ext_management_systems"."parent_ems_id" = "vms"."ems_id")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a. is it possible to define this higher up in the inheritance chain?
rewrite:
# Uses "ext_management_systems"."parent_ems_id" instead of "ext_management_systems"."id"
#
# ORDER BY ((
# SELECT COUNT(*)
# FROM "vms"
# WHERE "ext_management_systems"."parent_ems_id" = "vms"."ems_id"
# ))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm I think it need to be here, it's specific to NetworkManager (or StorageManager). So any manager that has Vms through :parent_manager
Reformat the comment nicely
Checked commits Ladas/manageiq@5c835d4~...e2c1e8a with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/manageiq/providers/network_manager.rb
|
kicking |
Fix ordering by VMs in NetworkManagers list
Fixes BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1383307