diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-24 13:01:31 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-09-27 11:19:20 -0300 |
commit | 5ced275ac1fc8d52654521bf61742cb7f2f0d796 (patch) | |
tree | 0373fdc2cdcb30484ededfa8c343f7b7d36b0e94 /actionpack/lib/action_dispatch/routing | |
parent | 5d773f8dedef85f3ef5d3bdebcedd72716002268 (diff) | |
download | rails-5ced275ac1fc8d52654521bf61742cb7f2f0d796.tar.gz rails-5ced275ac1fc8d52654521bf61742cb7f2f0d796.tar.bz2 rails-5ced275ac1fc8d52654521bf61742cb7f2f0d796.zip |
Remove old method before redefining it.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index b885a573d5..ebb9e194c7 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -161,6 +161,7 @@ module ActionDispatch # 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 @@ module ActionDispatch 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 |