diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-01 17:33:47 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-01 17:33:47 -0700 |
commit | 5cba5530ac5df837c55e93c85a3548667f1a9f14 (patch) | |
tree | e23095127e1d856923abe9c31ea068d5d3ea87bf /activerecord | |
parent | b9d98597cc3506bb1485f04ffd416e51c0e188bc (diff) | |
download | rails-5cba5530ac5df837c55e93c85a3548667f1a9f14.tar.gz rails-5cba5530ac5df837c55e93c85a3548667f1a9f14.tar.bz2 rails-5cba5530ac5df837c55e93c85a3548667f1a9f14.zip |
stop exposing the underlying alias datastructure
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index 68968e42a5..48a96fec64 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -91,8 +91,8 @@ module ActiveRecord # # Person.sum("2 * age") def calculate(operation, column_name, options = {}) - if column_name.is_a?(Symbol) && attribute_aliases.key?(column_name.to_s) - column_name = attribute_aliases[column_name.to_s].to_sym + if column_name.is_a?(Symbol) && attribute_alias?(column_name) + column_name = attribute_alias(column_name).to_sym end if has_include?(column_name) @@ -138,8 +138,8 @@ module ActiveRecord def pluck(*column_names) column_names.map! do |column_name| if column_name.is_a?(Symbol) - if attribute_aliases.key?(column_name.to_s) - column_name = attribute_aliases[column_name.to_s].to_sym + if attribute_alias?(column_name) + column_name = attribute_alias(column_name).to_sym end if self.columns_hash.key?(column_name.to_s) |