From 3a6f5d3d42381753a146bedbd13961a2d4f13a6c Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Mon, 20 Feb 2012 15:50:50 -0500 Subject: [PATCH] Don't rescue from User::DestroyWithOrdersError if it is not defined. Fixes #1155 --- core/app/controllers/spree/admin/users_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/app/controllers/spree/admin/users_controller.rb b/core/app/controllers/spree/admin/users_controller.rb index c2c6f554b1c..72b04a5635e 100644 --- a/core/app/controllers/spree/admin/users_controller.rb +++ b/core/app/controllers/spree/admin/users_controller.rb @@ -1,7 +1,9 @@ module Spree module Admin class UsersController < ResourceController - rescue_from User::DestroyWithOrdersError, :with => :user_destroy_with_orders_error + if User.const_defined?(DestroyWithOrdersError) + rescue_from User::DestroyWithOrdersError, :with => :user_destroy_with_orders_error + end # http://spreecommerce.com/blog/2010/11/02/json-hijacking-vulnerability/ before_filter :check_json_authenticity, :only => :index