Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix GuestDevice#child_device references
The child_devices added unneeded scope. This scope pulled back all ids from the guest devices table. Since the foreign_key is added to the query, this did not do any harm. But it adds an unneeded constraint an unneeded query. This was introduce in ManageIQ#15371 The way the PR was batted around, it looked like this was not an intentional side effect. Before ====== ```ruby has_many :child_devices, -> { where(:parent_device_id => ids) }, :foreign_key => "parent_device_id" has_many :child_devices, -> { where(:parent_device_id => GuestDevice.ids) }, :foreign_key => "parent_device_id" SELECT "guest_devices".* FROM "guest_devices" WHERE "guest_devices"."parent_device_id" = 26000000000035 AND "guest_devices"."parent_device_id" IN (26000000000032, 26000000000033, 26000000000034, 26000000000035, 26000000000036, 26000000000037, 26000000000038) ``` After ===== ```ruby has_many :child_devices, :foreign_key => "parent_device_id" SELECT "guest_devices".* FROM "guest_devices" WHERE "guest_devices"."parent_device_id" = 26000000000035 ```
- Loading branch information