Skip to content

Commit

Permalink
[CloudTenant] Fix "Dangerous query method"
Browse files Browse the repository at this point in the history
Fix for Rails 5.2, works in 5.1
  • Loading branch information
NickLaMuro committed Apr 3, 2020
1 parent fc1ddbe commit beb3815
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit beb3815

Please sign in to comment.