From 2b0d4816b82ca202728893d5800f2fc13a17b63b Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Wed, 4 Mar 2015 16:04:18 +0100 Subject: [PATCH] User super exestance check on instance is more stable than method_defined --- app/controllers/cmtool/application_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/cmtool/application_controller.rb b/app/controllers/cmtool/application_controller.rb index 54e85b9..540495b 100644 --- a/app/controllers/cmtool/application_controller.rb +++ b/app/controllers/cmtool/application_controller.rb @@ -21,10 +21,8 @@ module Cmtool end end - unless method_defined? :cmtool_user - def cmtool_user - current_user - end + def cmtool_user + defined?(super) ? super : current_user end helper_method :cmtool_user