mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Minor code formatting changes
This commit is contained in:
@@ -159,20 +159,22 @@ class Enterprise < ActiveRecord::Base
|
||||
self.relatives.is_distributor
|
||||
end
|
||||
|
||||
def suppliers
|
||||
self.relatives.is_primary_producer
|
||||
end
|
||||
|
||||
def website
|
||||
strip_url read_attribute(:website)
|
||||
end
|
||||
|
||||
def facebook
|
||||
strip_url read_attribute(:facebook)
|
||||
end
|
||||
|
||||
def linkedin
|
||||
strip_url read_attribute(:linkedin)
|
||||
end
|
||||
|
||||
def suppliers
|
||||
self.relatives.is_primary_producer
|
||||
end
|
||||
|
||||
def distributed_variants
|
||||
Spree::Variant.joins(:product).merge(Spree::Product.in_distributor(self)).select('spree_variants.*')
|
||||
end
|
||||
@@ -192,6 +194,7 @@ class Enterprise < ActiveRecord::Base
|
||||
where('spree_products.id IN (?)', Spree::Product.in_distributor(self)).
|
||||
select('DISTINCT spree_taxons.*')
|
||||
end
|
||||
|
||||
# Return all taxons for all supplied products
|
||||
def supplied_taxons
|
||||
Spree::Taxon.
|
||||
@@ -200,6 +203,7 @@ class Enterprise < ActiveRecord::Base
|
||||
select('DISTINCT spree_taxons.*')
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def strip_url(url)
|
||||
|
||||
@@ -22,7 +22,7 @@ class Api::UncachedEnterpriseSerializer < ActiveModel::Serializer
|
||||
end
|
||||
|
||||
def active
|
||||
@options[:active_distributors].andand.include?(object)
|
||||
@options[:active_distributors].andand.include? object
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user