Adding distributors display to producers page

This commit is contained in:
Will Marshall
2014-05-15 12:20:17 +10:00
parent 575ce9fe01
commit eae12da24a
5 changed files with 9 additions and 8 deletions

View File

@@ -141,7 +141,7 @@ class Enterprise < ActiveRecord::Base
end
def suppliers
self.relatives.is_supplier
self.relatives.is_primary_producer
end
def distributed_variants

View File

@@ -5,11 +5,8 @@ child distributed_taxons: :taxons do
attributes :name, :id
end
child producers: :producers do
child suppliers: :producers do
attributes :name, :id
node :path do |producer|
producer_path(producer_path)
end
end
node :pickup do |hub|

View File

@@ -8,7 +8,7 @@ end
child distributors: :distributors do
attributes :name, :id
node :path do |distributor|
distributor_path(distributor)
shop_enterprise_path(distributor)
end
end

View File

@@ -5,9 +5,13 @@
{{ producer.taxons | printArrayOfObjects }}
.columns.small-4
%strong About us
{{ producer.description }}
%p.trans-sentence
{{ producer.description }}
.columns.small-4
%strong Our distributors
%ul
%li{"ng-repeat" => "distributor in producer.distributors"}
%a{"bo-href" => "distributor.path"}{{ distributor.name }}
.row.active_table_row.link{"ng-show" => "open()", "ng-repeat" => "hub in producer.hubs"}
.columns.small-11

View File

@@ -47,7 +47,7 @@ describe Enterprise do
it "scopes relatives to producers" do
e.should_receive(:relatives).and_return(relatives = [])
relatives.should_receive(:is_supplier)
relatives.should_receive(:is_primary_producer)
e.suppliers
end
end