Permalink
Browse files

move default_notification_payload into config.to_prepare, call it on …

…Spree::BaseController instead
  • Loading branch information...
1 parent 96875e5 commit 463d30749b1e04fac911155c8f3860643323439e @radar radar committed May 31, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 promo/lib/spree/promo/engine.rb
@@ -7,14 +7,15 @@ class Engine < Rails::Engine
def self.activate
Dir.glob(File.join(File.dirname(__FILE__), '../../../app/**/*_decorator*.rb')) do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
- end
- # Include list of visited paths in notification payload hash
- Spree::Core::ControllerHelpers.class_eval do
- def default_notification_payload
- { :user => spree_current_user, :order => current_order, :visited_paths => session[:visited_paths] }
+ Spree::BaseController.class_eval do
+ # Include list of visited paths in notification payload hash
+ def default_notification_payload
+ { :user => spree_current_user, :order => current_order, :visited_paths => session[:visited_paths] }
+ end
end
end
+
end
config.autoload_paths += %W(#{config.root}/lib)

0 comments on commit 463d307

Please sign in to comment.