mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-17 04:34:24 +00:00
reorganise and document enterprise categories
This commit is contained in:
@@ -219,10 +219,13 @@ class Enterprise < ActiveRecord::Base
|
||||
"own"
|
||||
end
|
||||
|
||||
def enterprise_category
|
||||
# Using profile instead of cant_sell was blocking the non selling supplier case and limiting more than it needed to.
|
||||
|
||||
# New boolean field shows whether we can supply products into the system.
|
||||
def supplies
|
||||
is_primary_producer && type != "profile" #and has distributors?
|
||||
end
|
||||
|
||||
# Simplify enterprise categories for frontend logic and icons, and maybe other things.
|
||||
def enterprise_category
|
||||
# Make this crazy logic human readable so we can argue about it sanely.
|
||||
# This can be simplified later, it's like this for readablitlty during changes.
|
||||
category = is_primary_producer ? "producer_" : "non_producer_"
|
||||
@@ -261,12 +264,6 @@ class Enterprise < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
# New boolean field shows whether we can supply products into the system.
|
||||
def supplies
|
||||
is_primary_producer && type != "profile" #and has distributors?
|
||||
end
|
||||
|
||||
|
||||
# Return all taxons for all distributed products
|
||||
def distributed_taxons
|
||||
Spree::Taxon.
|
||||
|
||||
Reference in New Issue
Block a user