diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 8be6946927..a72c6fdbd6 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -141,7 +141,7 @@ class Enterprise < ActiveRecord::Base end def suppliers - self.relatives.is_supplier + self.relatives.is_primary_producer end def distributed_variants diff --git a/app/views/json/_hubs.rabl b/app/views/json/_hubs.rabl index 1950c9903b..a6958840bc 100644 --- a/app/views/json/_hubs.rabl +++ b/app/views/json/_hubs.rabl @@ -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| diff --git a/app/views/json/_producers.rabl b/app/views/json/_producers.rabl index b5111bc0cb..717347e5de 100644 --- a/app/views/json/_producers.rabl +++ b/app/views/json/_producers.rabl @@ -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 diff --git a/app/views/producers/_fat.html.haml b/app/views/producers/_fat.html.haml index dfac8fd31f..68acee1d12 100644 --- a/app/views/producers/_fat.html.haml +++ b/app/views/producers/_fat.html.haml @@ -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 diff --git a/spec/models/enterprise_spec.rb b/spec/models/enterprise_spec.rb index 96f64ecfee..06c4c0850e 100644 --- a/spec/models/enterprise_spec.rb +++ b/spec/models/enterprise_spec.rb @@ -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