Skip to content

Commit

Permalink
Use #remove_possible_method instead here
Browse files Browse the repository at this point in the history
  • Loading branch information
smartinez87 committed May 4, 2011
1 parent 1c2dc92 commit 9be7911
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions actionpack/lib/action_dispatch/routing/route_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/to_query'
require 'active_support/core_ext/hash/slice'
require 'active_support/core_ext/module/remove_method'

module ActionDispatch
module Routing
Expand Down Expand Up @@ -160,7 +161,7 @@ def define_hash_access(route, name, kind, options)

# We use module_eval to avoid leaks
@module.module_eval <<-END_EVAL, __FILE__, __LINE__ + 1
remove_method :#{selector} if method_defined?(:#{selector})
remove_possible_method :#{selector}
def #{selector}(*args)
options = args.extract_options!
Expand Down Expand Up @@ -194,7 +195,7 @@ def define_url_helper(route, name, kind, options)
hash_access_method = hash_access_name(name, kind)

@module.module_eval <<-END_EVAL, __FILE__, __LINE__ + 1
remove_method :#{selector} if method_defined?(:#{selector})
remove_possible_method :#{selector}
def #{selector}(*args)
url_for(#{hash_access_method}(*args))
end
Expand Down

0 comments on commit 9be7911

Please sign in to comment.