From 7e96acb8a369d76b315212844ba8925851da4689 Mon Sep 17 00:00:00 2001 From: Ian White Date: Tue, 25 Nov 2008 13:41:31 +1100 Subject: [PATCH] refactored changes in #5608075 [#1] --- lib/ardes/resources_controller/helper.rb | 6 ++---- lib/ardes/resources_controller/named_route_helper.rb | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/ardes/resources_controller/helper.rb b/lib/ardes/resources_controller/helper.rb index 320f6a4..a49edb6 100644 --- a/lib/ardes/resources_controller/helper.rb +++ b/lib/ardes/resources_controller/helper.rb @@ -101,10 +101,8 @@ def method_missing_with_named_route_helper(method, *args, &block) end # delegate url help method creation to the controller - def respond_to_with_named_route_helper?(method, include_private = false) - # only pass include_private when it's set, to stop older software blowing up - normally_responds_to = include_private ? respond_to_without_named_route_helper?(method, include_private) : respond_to_without_named_route_helper?(method) - normally_responds_to || controller.resource_named_route_helper_method?(method) + def respond_to_with_named_route_helper?(*args) + respond_to_without_named_route_helper?(*args) || controller.resource_named_route_helper_method?(args.first) end private diff --git a/lib/ardes/resources_controller/named_route_helper.rb b/lib/ardes/resources_controller/named_route_helper.rb index 7faeb3e..c2c9c76 100644 --- a/lib/ardes/resources_controller/named_route_helper.rb +++ b/lib/ardes/resources_controller/named_route_helper.rb @@ -54,10 +54,8 @@ def method_missing_with_named_route_helper(method, *args, &block) end end - def respond_to_with_named_route_helper?(method, include_private = false) - # only pass include_private when it's set, to stop older software blowing up - normally_responds_to = include_private ? respond_to_without_named_route_helper?(method, include_private) : respond_to_without_named_route_helper?(method) - normally_responds_to || resource_named_route_helper_method?(method) + def respond_to_with_named_route_helper?(*args) + respond_to_without_named_route_helper?(*args) || resource_named_route_helper_method?(args.first) end # return true if the passed method (e.g. 'resources_path') corresponds to a defined