aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-05-04 20:15:34 +0200
committerXavier Noria <fxn@hashref.com>2011-05-04 20:15:34 +0200
commitaada1a4f788490317febcb63f96ead277b9e9165 (patch)
tree8a6f48a05483190d379b01ab15d791f325176deb
parent47e1cca5dcceb7534cb9548d36d93b78ed1f1d81 (diff)
parent871096d85426b49bf97c0de01850df248b7d714c (diff)
downloadrails-aada1a4f788490317febcb63f96ead277b9e9165.tar.gz
rails-aada1a4f788490317febcb63f96ead277b9e9165.tar.bz2
rails-aada1a4f788490317febcb63f96ead277b9e9165.zip
Merge branch 'master' of github.com:rails/rails
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb5
-rw-r--r--activesupport/lib/active_support/core_ext/class/attribute.rb2
2 files changed, 4 insertions, 3 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
diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb
index 5414b3a18f..7baba75ad3 100644
--- a/activesupport/lib/active_support/core_ext/class/attribute.rb
+++ b/activesupport/lib/active_support/core_ext/class/attribute.rb
@@ -84,7 +84,7 @@ class Class
val
end
- remove_method :#{name} if method_defined?(:#{name})
+ remove_possible_method :#{name}
def #{name}
defined?(@#{name}) ? @#{name} : self.class.#{name}
end