From acfb1bd600667f013208b2b21b1544742c2df5ea Mon Sep 17 00:00:00 2001 From: alexs Date: Wed, 21 Aug 2013 12:03:44 +1000 Subject: [PATCH] Making sure that only distributor enterprises are displayed on the landing page. --- app/controllers/home_controller.rb | 4 ++-- config/distributors.yml | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index a91a0d17d5..54e876e9a3 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -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 diff --git a/config/distributors.yml b/config/distributors.yml index f197961415..c410b2970f 100644 --- a/config/distributors.yml +++ b/config/distributors.yml @@ -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: