Permalink
Browse files

stop passing *args to generate aliases

  • Loading branch information...
1 parent d5a8bdb commit f77beac8a66a15b1e6f100e4134c79338ee9756b @tenderlove tenderlove committed Nov 15, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 activerecord/lib/active_record/relation/calculations.rb
@@ -334,10 +334,8 @@ def execute_grouped_calculation(operation, column_name, distinct) #:nodoc:
# column_alias_for("count(distinct users.id)") # => "count_distinct_users_id"
# column_alias_for("count(*)") # => "count_all"
# column_alias_for("count", "id") # => "count_id"
- def column_alias_for(*keys)
- keys.map! {|k| k.respond_to?(:to_sql) ? k.to_sql : k}
- table_name = keys.join(' ')
- table_name.downcase!
+ def column_alias_for(keys)
+ table_name = keys.to_s.downcase
table_name.gsub!(/\*/, 'all')
table_name.gsub!(/\W+/, ' ')
table_name.strip!

0 comments on commit f77beac

Please sign in to comment.