aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-03-22 18:29:11 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-03-22 18:29:11 -0300
commit4ba9c55fcd2ba5dfd625b7a6a1a4adafd984c4dc (patch)
tree9c2c2703d577681842a7a3c711f819ff3c6ae533 /guides/source
parent6a8d3e6ba0ece2e182c430bf44837f86fa93acba (diff)
parenta982a42d766169c2170d7f100c2a5ceb5430efb1 (diff)
downloadrails-4ba9c55fcd2ba5dfd625b7a6a1a4adafd984c4dc.tar.gz
rails-4ba9c55fcd2ba5dfd625b7a6a1a4adafd984c4dc.tar.bz2
rails-4ba9c55fcd2ba5dfd625b7a6a1a4adafd984c4dc.zip
Merge pull request #19434 from kirs/deprecate-alias-method-chain
Deprecate alias_method_chain in favour of Module#prepend
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/active_support_core_extensions.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md
index 66626f41d1..f3d8e05089 100644
--- a/guides/source/active_support_core_extensions.md
+++ b/guides/source/active_support_core_extensions.md
@@ -506,6 +506,8 @@ Extensions to `Module`
### `alias_method_chain`
+**This method is deprecated in favour of using Module#prepend.**
+
Using plain Ruby you can wrap methods with other methods, that's called _alias chaining_.
For example, let's say you'd like params to be strings in functional tests, as they are in real requests, but still want the convenience of assigning integers and other kind of values. To accomplish that you could wrap `ActionController::TestCase#process` this way in `test/test_helper.rb`:
@@ -550,8 +552,6 @@ ActionController::TestCase.class_eval do
end
```
-Rails uses `alias_method_chain` all over the code base. For example validations are added to `ActiveRecord::Base#save` by wrapping the method that way in a separate module specialized in validations.
-
NOTE: Defined in `active_support/core_ext/module/aliasing.rb`.
### Attributes