mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Removing visible scopes from enteprise distributors and producers
This commit is contained in:
@@ -156,7 +156,7 @@ class Enterprise < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def distributors
|
||||
self.relatives.is_distributor.visible
|
||||
self.relatives.is_distributor
|
||||
end
|
||||
|
||||
def website
|
||||
@@ -170,7 +170,7 @@ class Enterprise < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def suppliers
|
||||
self.relatives.is_primary_producer.visible
|
||||
self.relatives.is_primary_producer
|
||||
end
|
||||
|
||||
def distributed_variants
|
||||
|
||||
@@ -42,14 +42,12 @@ describe Enterprise do
|
||||
it "scopes relatives to visible distributors" do
|
||||
e.should_receive(:relatives).and_return(relatives = [])
|
||||
relatives.should_receive(:is_distributor).and_return relatives
|
||||
relatives.should_receive(:visible)
|
||||
e.distributors
|
||||
end
|
||||
|
||||
it "scopes relatives to visible producers" do
|
||||
e.should_receive(:relatives).and_return(relatives = [])
|
||||
relatives.should_receive(:is_primary_producer).and_return relatives
|
||||
relatives.should_receive(:visible)
|
||||
e.suppliers
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user