aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-07-19 10:09:40 +0000
committerMichael Koziarski <michael@koziarski.com>2007-07-19 10:09:40 +0000
commit1eb79bcc3b5df2ee4e037d06835a88961eb0a429 (patch)
treed6b0f6ce28c9e5882d7d79e107d76be077773450 /activesupport/lib/active_support/core_ext
parenta41305640722f1328ff51ce61c98371d4b648213 (diff)
downloadrails-1eb79bcc3b5df2ee4e037d06835a88961eb0a429.tar.gz
rails-1eb79bcc3b5df2ee4e037d06835a88961eb0a429.tar.bz2
rails-1eb79bcc3b5df2ee4e037d06835a88961eb0a429.zip
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
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/module/aliasing.rb4
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 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