Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove old method before redefining it.

  • Loading branch information...
commit 5ced275ac1fc8d52654521bf61742cb7f2f0d796 1 parent 5d773f8
@miloops miloops authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  actionpack/lib/action_dispatch/routing/route_set.rb
View
2  actionpack/lib/action_dispatch/routing/route_set.rb
@@ -161,6 +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})
def #{selector}(*args)
options = args.extract_options!
@@ -194,6 +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})
def #{selector}(*args)
url_for(#{hash_access_method}(*args))
end
Please sign in to comment.
Something went wrong with that request. Please try again.