Files
openfoodnetwork/app/views/shared/_hubs.rabl
2014-04-18 16:35:06 +10:00

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?