From beb38151bafd0fd6aed3f20292f697f11149942f Mon Sep 17 00:00:00 2001 From: Nick LaMuro Date: Fri, 3 Apr 2020 17:20:20 -0500 Subject: [PATCH] [CloudTenant] Fix "Dangerous query method" Fix for Rails 5.2, works in 5.1 --- .../manageiq/providers/openstack/cloud_manager/cloud_tenant.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/manageiq/providers/openstack/cloud_manager/cloud_tenant.rb b/app/models/manageiq/providers/openstack/cloud_manager/cloud_tenant.rb index a56c7dcbb..c99bf5c66 100644 --- a/app/models/manageiq/providers/openstack/cloud_manager/cloud_tenant.rb +++ b/app/models/manageiq/providers/openstack/cloud_manager/cloud_tenant.rb @@ -59,7 +59,7 @@ def default_security_group # then return the security group with the most VMs in it. security_groups.left_joins(:network_port_security_groups) .group(:id) - .order('COUNT(network_ports_security_groups.security_group_id) DESC NULLS LAST') + .order(Arel.sql('COUNT(network_ports_security_groups.security_group_id) DESC NULLS LAST')) .first end