diff options
author | Zachary Scott <e@zzak.io> | 2014-10-04 16:52:13 -0700 |
---|---|---|
committer | Zachary Scott <e@zzak.io> | 2014-10-04 16:52:13 -0700 |
commit | edc24da94002703cdd78c419942d3ead6ca40326 (patch) | |
tree | 36180e4cdd835c809f069c8492c7b2aa0046a61b /activesupport | |
parent | a4d8b62ed19a0985a8f8cf8e7efe09263763f707 (diff) | |
parent | 619f82bf18686f669080a7200d02024fa8817bff (diff) | |
download | rails-edc24da94002703cdd78c419942d3ead6ca40326.tar.gz rails-edc24da94002703cdd78c419942d3ead6ca40326.tar.bz2 rails-edc24da94002703cdd78c419942d3ead6ca40326.zip |
Merge pull request #17176 from kuldeepaggarwal/doc-alias_method_chain
doc added for `writer` method in `alias_method_chain` [ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/aliasing.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/aliasing.rb b/activesupport/lib/active_support/core_ext/module/aliasing.rb index 580cb80413..0a6fadf928 100644 --- a/activesupport/lib/active_support/core_ext/module/aliasing.rb +++ b/activesupport/lib/active_support/core_ext/module/aliasing.rb @@ -19,9 +19,9 @@ class Module # alias_method :foo_without_feature?, :foo? # alias_method :foo?, :foo_with_feature? # - # so you can safely chain foo, foo?, and foo! with the same feature. + # so you can safely chain foo, foo?, foo! and/or foo= with the same feature. def alias_method_chain(target, feature) - # Strip out punctuation on predicates or bang methods since + # Strip out punctuation on predicates, bang or writer methods since # e.g. target?_without_feature is not a valid method name. aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1 yield(aliased_target, punctuation) if block_given? |