Add ditributors and suppliers to OC show API

This commit is contained in:
Rob H
2014-03-05 12:17:08 +11:00
parent fc65eefcfd
commit 1635e7338e
2 changed files with 8 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
object @order_cycle
attributes :id, :name
attributes :id, :name
node( :suppliers ) do |oc|
partial 'spree/api/enterprises/bulk_index', :object => oc.suppliers
end
node( :distributors ) do |oc|
partial 'spree/api/enterprises/bulk_index', :object => oc.distributors
end

View File

@@ -8,7 +8,7 @@ module Api
let!(:oc1) { FactoryGirl.create(:order_cycle) }
let!(:oc2) { FactoryGirl.create(:order_cycle) }
let(:attributes) { [:id, :name] }
let(:attributes) { [:id, :name, :suppliers, :distributors] }
before do
stub_authentication!