From d1b9ce92f6e5c9ffffe3409520be3c67a32ba219 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 25 Oct 2012 10:26:32 +1100 Subject: [PATCH] Move distributors helper out of spree namespace --- app/controllers/spree/home_controller_decorator.rb | 2 +- app/controllers/spree/products_controller_decorator.rb | 2 +- app/controllers/spree/taxons_controller_decorator.rb | 2 +- app/helpers/distributors_helper.rb | 5 +++++ app/helpers/spree/distributors_helper.rb | 7 ------- 5 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 app/helpers/distributors_helper.rb delete mode 100644 app/helpers/spree/distributors_helper.rb diff --git a/app/controllers/spree/home_controller_decorator.rb b/app/controllers/spree/home_controller_decorator.rb index c5bb07c687..f82db2ff50 100644 --- a/app/controllers/spree/home_controller_decorator.rb +++ b/app/controllers/spree/home_controller_decorator.rb @@ -1,7 +1,7 @@ require 'open_food_web/split_products_by_distributor' Spree::HomeController.class_eval do - include Spree::DistributorsHelper + include DistributorsHelper include OpenFoodWeb::SplitProductsByDistributor respond_override :index => { :html => { :success => lambda { diff --git a/app/controllers/spree/products_controller_decorator.rb b/app/controllers/spree/products_controller_decorator.rb index e7964028e9..17d134c2d9 100644 --- a/app/controllers/spree/products_controller_decorator.rb +++ b/app/controllers/spree/products_controller_decorator.rb @@ -1,7 +1,7 @@ require 'open_food_web/split_products_by_distributor' Spree::ProductsController.class_eval do - include Spree::DistributorsHelper + include DistributorsHelper include OpenFoodWeb::SplitProductsByDistributor respond_override :index => { :html => { :success => lambda { diff --git a/app/controllers/spree/taxons_controller_decorator.rb b/app/controllers/spree/taxons_controller_decorator.rb index a6aacc38a1..0fb7517995 100644 --- a/app/controllers/spree/taxons_controller_decorator.rb +++ b/app/controllers/spree/taxons_controller_decorator.rb @@ -1,7 +1,7 @@ require 'open_food_web/split_products_by_distributor' Spree::TaxonsController.class_eval do - include Spree::DistributorsHelper + include DistributorsHelper include OpenFoodWeb::SplitProductsByDistributor respond_override :show => { :html => { :success => lambda { diff --git a/app/helpers/distributors_helper.rb b/app/helpers/distributors_helper.rb new file mode 100644 index 0000000000..c641807e99 --- /dev/null +++ b/app/helpers/distributors_helper.rb @@ -0,0 +1,5 @@ +module DistributorsHelper + def current_distributor + @current_distributor ||= current_order(false).andand.distributor + end +end diff --git a/app/helpers/spree/distributors_helper.rb b/app/helpers/spree/distributors_helper.rb deleted file mode 100644 index 398be01372..0000000000 --- a/app/helpers/spree/distributors_helper.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Spree - module DistributorsHelper - def current_distributor - @current_distributor ||= current_order(false).andand.distributor - end - end -end