aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-12 07:10:43 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-12 07:10:43 +0000
commit74f60c032e92b2473b5feeeb85782836c2b83fdd (patch)
tree97d9d1975e8d6a3a286a3e2fa20480f224493255 /activesupport/lib
parent3c0e7b1b51cb775e55a4b10a9872f74cecacd6a7 (diff)
downloadrails-74f60c032e92b2473b5feeeb85782836c2b83fdd.tar.gz
rails-74f60c032e92b2473b5feeeb85782836c2b83fdd.tar.bz2
rails-74f60c032e92b2473b5feeeb85782836c2b83fdd.zip
alias_method_chain works with accessor= methods also. Closes #6153.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5091 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/module/aliasing.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/aliasing.rb b/activesupport/lib/active_support/core_ext/module/aliasing.rb
index a4c7e539e3..19a9297aa4 100644
--- a/activesupport/lib/active_support/core_ext/module/aliasing.rb
+++ b/activesupport/lib/active_support/core_ext/module/aliasing.rb
@@ -23,7 +23,7 @@ class Module
def alias_method_chain(target, feature)
# Strip out punctuation on predicates or bang methods since
# e.g. target?_without_feature is not a valid method name.
- aliased_target, punctuation = target.to_s.sub(/([?!])$/, ''), $1
+ aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
alias_method "#{aliased_target}_without_#{feature}#{punctuation}", target
alias_method target, "#{aliased_target}_with_#{feature}#{punctuation}"
end