Remove unused method enterprise method

`Enterprise.has_supplied_products_on_hand?` is not used anywhere.
This commit is contained in:
Maikel Linke
2018-06-27 11:25:44 +10:00
parent 792701297b
commit 306bfa1944
2 changed files with 0 additions and 24 deletions

View File

@@ -193,10 +193,6 @@ class Enterprise < ActiveRecord::Base
end
end
def has_supplied_products_on_hand?
self.supplied_products.where('count_on_hand > 0').present?
end
def to_param
permalink
end

View File

@@ -489,26 +489,6 @@ describe Enterprise do
end
end
describe "has_supplied_products_on_hand?" do
before :each do
@supplier = create(:supplier_enterprise)
end
it "returns false when no products" do
@supplier.should_not have_supplied_products_on_hand
end
it "returns false when the product is out of stock" do
create(:product, :supplier => @supplier, :on_hand => 0)
@supplier.should_not have_supplied_products_on_hand
end
it "returns true when the product is in stock" do
create(:product, :supplier => @supplier, :on_hand => 1)
@supplier.should have_supplied_products_on_hand
end
end
describe "finding variants distributed by the enterprise" do
it "finds master and other variants" do
d = create(:distributor_enterprise)