column_alias_for(*keys)
private
converts a given key to the value that the database adapter returns as
users.id
sum(id)
count(distinct users.id)
count(*)
Show source
def column_alias_for(*keys)
connection.table_alias_for(keys.join(' ').downcase.gsub(/\*/, 'all').gsub(/\W+/, ' ').strip.gsub(/ +/, '_'))
end