aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2010-07-17 17:28:07 +0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-19 23:44:46 +0800
commitfc71d592195b6e04e04cdbb5e640716b0d909e91 (patch)
tree0c14affc958db48099b87a8f987891a9b5d5a1cf /activesupport
parent247886e1b4256aeebc6b5fde0549400240b04e35 (diff)
downloadrails-fc71d592195b6e04e04cdbb5e640716b0d909e91.tar.gz
rails-fc71d592195b6e04e04cdbb5e640716b0d909e91.tar.bz2
rails-fc71d592195b6e04e04cdbb5e640716b0d909e91.zip
Introduced redefine_method
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/module/remove_method.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/remove_method.rb b/activesupport/lib/active_support/core_ext/module/remove_method.rb
index 2714a46b28..b8c01aca0e 100644
--- a/activesupport/lib/active_support/core_ext/module/remove_method.rb
+++ b/activesupport/lib/active_support/core_ext/module/remove_method.rb
@@ -3,4 +3,9 @@ class Module
remove_method(method)
rescue NameError
end
+
+ def redefine_method(method, &block)
+ remove_possible_method(method)
+ define_method(method, &block)
+ end
end \ No newline at end of file