Skip to content

Commit

Permalink
Use strings for nested joins
Browse files Browse the repository at this point in the history
In the following:

rails/rails#25146

Rails added a regression to making nested joins with references to those
joins in the WHERE clause, and this causes an error when running this
test suite in Rails 5.0.1.

This has been addressed in Rails with:

rails/rails#27598

And has been merged into master, but it is likely that Rails 5.0.1 will
not be pulled from Rubygems, and the ManageIQ will fail to run tests
properly with that version of Rails.

Because of that, and to allow the tests to function in the same way, the
simplest thing to do is to stringify the keys manually avoid the error
for now.  This is against the convention (most Rails devs prefer
symbols), but this allows the tests to remain as they were.
  • Loading branch information
NickLaMuro authored and chrisarcand committed Jan 9, 2017
1 parent 28a71e9 commit 4e96ee4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
:manager_ref => [:vm_or_template])
@data[:disks] = ::ManagerRefresh::InventoryCollection.new(
Disk,
:arel => @ems.disks.joins(:hardware => :vm_or_template).where(:hardware => {:vms => {:ems_ref => vm_refs}}),
:arel => @ems.disks.joins(:hardware => :vm_or_template).where('hardware' => {'vms' => {'ems_ref' => vm_refs}}),
:manager_ref => [:hardware, :device_name])

@vm_data_3 = vm_data(3).merge(
Expand Down Expand Up @@ -393,7 +393,7 @@
:manager_ref => [:vm_or_template])
@data[:disks] = ::ManagerRefresh::InventoryCollection.new(
Disk,
:arel => @ems.disks.joins(:hardware => :vm_or_template).where(:hardware => {:vms => {:ems_ref => vm_refs}}),
:arel => @ems.disks.joins(:hardware => :vm_or_template).where('hardware' => {'vms' => {'ems_ref' => vm_refs}}),
:manager_ref => [:hardware, :device_name])
@data[:image_hardwares] = ::ManagerRefresh::InventoryCollection.new(
Hardware,
Expand Down

0 comments on commit 4e96ee4

Please sign in to comment.