Simplify, simplify

This commit is contained in:
Rohan Mitchell
2015-01-30 15:54:44 +11:00
parent 7ac888ae00
commit fafbfe8735
2 changed files with 2 additions and 2 deletions

View File

@@ -46,7 +46,7 @@ module OpenFoodNetwork
# Find the exchanges of an order cycle that an admin can manage
def order_cycle_exchanges(order_cycle)
enterprises = managed_enterprises + related_enterprises_with(:add_to_order_cycle)
enterprises = managed_and_related_enterprises_with :add_to_order_cycle
order_cycle.exchanges.to_enterprises(enterprises).from_enterprises(enterprises)
end

View File

@@ -216,7 +216,7 @@ module Spree
context "when is a distributor enterprise user" do
# create distributor_enterprise1 user without full admin access
let (:user) do
let(:user) do
user = create(:user)
user.spree_roles = []
d1.enterprise_roles.build(user: user).save