Merge pull request #8112 from cillian/eager-load-permissions-with-enterprise-relationships

Eager load the EnterpriseRelationship :permissions association on the enterprise permissions page
This commit is contained in:
Matt-Yorkley
2021-09-08 19:46:14 +02:00
committed by GitHub

View File

@@ -8,7 +8,7 @@ module Admin
managed_by(spree_current_user).by_name
@all_enterprises = Enterprise.includes(:shipping_methods, :payment_methods).by_name
@enterprise_relationships = EnterpriseRelationship.
includes(:parent, :child).
includes(:parent, :child, :permissions).
by_name.involving_enterprises @my_enterprises
end