diff options
author | Sebastian Martinez <sebastian@wyeworks.com> | 2011-05-04 15:13:40 -0300 |
---|---|---|
committer | Sebastian Martinez <sebastian@wyeworks.com> | 2011-05-04 15:13:40 -0300 |
commit | 9be7911e873e1ba0d0b0bac197b426693b4f3885 (patch) | |
tree | ad1a2b0ce6ac4aea0327f80e088807ce6d24accc /actionpack/lib/action_dispatch | |
parent | 1c2dc92aaeee1b5247957f626343e767418c3780 (diff) | |
download | rails-9be7911e873e1ba0d0b0bac197b426693b4f3885.tar.gz rails-9be7911e873e1ba0d0b0bac197b426693b4f3885.tar.bz2 rails-9be7911e873e1ba0d0b0bac197b426693b4f3885.zip |
Use #remove_possible_method instead here
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 963a9107da..97e8ccc9a5 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -3,6 +3,7 @@ require 'forwardable' 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 @@ module ActionDispatch # 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 @@ 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}) + remove_possible_method :#{selector} def #{selector}(*args) url_for(#{hash_access_method}(*args)) end |