Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use #remove_possible_method instead here

  • Loading branch information...
commit 9be7911e873e1ba0d0b0bac197b426693b4f3885 1 parent 1c2dc92
@smartinez87 authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionpack/lib/action_dispatch/routing/route_set.rb
View
5 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -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
@@ -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!
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.