mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-17 04:34:24 +00:00
35 lines
647 B
Ruby
35 lines
647 B
Ruby
collection Enterprise.is_distributor
|
|
attributes :name, :id
|
|
|
|
child :address do
|
|
attributes :city, :zipcode
|
|
node :state do |address|
|
|
address.state.abbr
|
|
end
|
|
end
|
|
|
|
node :pickup do |hub|
|
|
not hub.shipping_methods.where(:require_ship_address => false).empty?
|
|
end
|
|
|
|
node :delivery do |hub|
|
|
not hub.shipping_methods.where(:require_ship_address => true).empty?
|
|
end
|
|
|
|
node :path do |hub|
|
|
shop_enterprise_path(hub)
|
|
end
|
|
|
|
#node :active do |hub|
|
|
##@active_distributors.include?(hub)
|
|
#end
|
|
|
|
#child :shipping_methods do
|
|
#attributes :name, :require_ship_address
|
|
#end
|
|
|
|
# ALL PRODUCERS
|
|
#
|
|
# Orders closing when?
|
|
# Current order_cycle + closing when?
|