From 1635e7338e652289c5378ccb0e14634baee2d4ab Mon Sep 17 00:00:00 2001 From: Rob H Date: Wed, 5 Mar 2014 12:17:08 +1100 Subject: [PATCH] Add ditributors and suppliers to OC show API --- app/views/api/order_cycles/bulk_show.v1.rabl | 8 +++++++- spec/controllers/api/order_cycles_controller_spec.rb | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/api/order_cycles/bulk_show.v1.rabl b/app/views/api/order_cycles/bulk_show.v1.rabl index 7acffca853..814985ef53 100644 --- a/app/views/api/order_cycles/bulk_show.v1.rabl +++ b/app/views/api/order_cycles/bulk_show.v1.rabl @@ -1,3 +1,9 @@ object @order_cycle -attributes :id, :name \ No newline at end of file +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 \ No newline at end of file diff --git a/spec/controllers/api/order_cycles_controller_spec.rb b/spec/controllers/api/order_cycles_controller_spec.rb index 3524aafc94..3c562840f5 100644 --- a/spec/controllers/api/order_cycles_controller_spec.rb +++ b/spec/controllers/api/order_cycles_controller_spec.rb @@ -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!