Making sure that only distributor enterprises are displayed on the landing page.

This commit is contained in:
alexs
2013-08-21 12:03:44 +10:00
parent 798565bb42
commit acfb1bd600
2 changed files with 16 additions and 15 deletions

View File

@@ -15,8 +15,8 @@ class HomeController < ApplicationController
region[:name] = region_data["name"]
distributors = []
region_data["distributors"].each do |distributor_data|
distributor = Enterprise.find_by_name(distributor_data["name"])
distributors << distributor unless distributor.nil?
enterprise = Enterprise.find_by_name(distributor_data["name"])
distributors << enterprise if !enterprise.nil? && enterprise.is_distributor
end
region[:distributors] = distributors
@regions << region

View File

@@ -37,28 +37,29 @@ staging:
regions:
- name: "Inner Melbourne"
distributors:
- name: "AB Organics"
- name: "Biodynamic Marketing"
- name: "Carefully selected"
- name: "Ballantyne (Thornbury)"
- name: "Childcare Center Near You"
- name: "Northcote Bulk Foods Coop :)"
- name: "South East Melbourne"
distributors:
- name: "Common Fields"
- name: "Great Western Olives"
- name: "Kindred Organic"
- name: "LO"
- name: "Delivery (Cafes / Restaurants only)"
- name: "Grow Lightly (Inverloch)"
- name: "Grow Lightly (Korumburra)"
- name: "Grow Lightly (Leongatha)"
- name: "Mildura"
distributors:
- name: "Manna Hill Olives"
- name: "Matt's Patch"
- name: "Old McDonald's Daughter"
- name: "LO"
- name: "Murrnong"
- name: "Murrnong (Violet Town)"
- name: "South East Gippsland"
distributors:
- name: "Paddock to Plate"
- name: "Powlett Hill"
- name: "Urban Honey Co"
- name: "Neighbourhood Coop"
- name: "Northcote Bulk Foods Coop :)"
- name: "Murundaka (Heidelberg)"
- name: "PepperTree Place (Coburg)"
production:
regions: