aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorKir Shatrov <shatrov@me.com>2015-03-20 23:23:41 +0200
committerKir Shatrov <shatrov@me.com>2015-03-22 23:11:19 +0200
commita982a42d766169c2170d7f100c2a5ceb5430efb1 (patch)
treed0513809ec34dc58732cff47b18f4840ff127ade /guides/source
parentcdbe4fd093a38d9c7c5860138844b7da272556fc (diff)
downloadrails-a982a42d766169c2170d7f100c2a5ceb5430efb1.tar.gz
rails-a982a42d766169c2170d7f100c2a5ceb5430efb1.tar.bz2
rails-a982a42d766169c2170d7f100c2a5ceb5430efb1.zip
Deprecate alias_method_chain in favour of Module#prepend
…as discussed #19413
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