Skip to content

Commit

Permalink
refactored changes in #5608075 [#1]
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Nov 25, 2008
1 parent 5608075 commit 7e96acb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions lib/ardes/resources_controller/helper.rb
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions lib/ardes/resources_controller/named_route_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit 7e96acb

Please sign in to comment.