From 1eb79bcc3b5df2ee4e037d06835a88961eb0a429 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Thu, 19 Jul 2007 10:09:40 +0000 Subject: Let alias_attribute work with attributes with initial capital letters (legacy columns etc). Closes #8596 [mpalmer] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7195 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/module/aliasing.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/core_ext/module/aliasing.rb b/activesupport/lib/active_support/core_ext/module/aliasing.rb index b36874520b..0280878b77 100644 --- a/activesupport/lib/active_support/core_ext/module/aliasing.rb +++ b/activesupport/lib/active_support/core_ext/module/aliasing.rb @@ -62,8 +62,8 @@ class Module # e.title # => "Megastars" def alias_attribute(new_name, old_name) module_eval <<-STR, __FILE__, __LINE__+1 - def #{new_name}; #{old_name}; end - def #{new_name}?; #{old_name}?; end + def #{new_name}; self.#{old_name}; end + def #{new_name}?; self.#{old_name}?; end def #{new_name}=(v); self.#{old_name} = v; end STR end -- cgit v1.2.3