method

column_alias_for

Importance_1
v2.1.0 - Show latest stable - 0 notes - Class: ActiveRecord::Calculations::ClassMethods
column_alias_for(*keys) private

Converts the given keys to the value that the database adapter returns as a usable column name:

  column_alias_for("users.id")                 # => "users_id"
  column_alias_for("sum(id)")                  # => "sum_id"
  column_alias_for("count(distinct users.id)") # => "count_distinct_users_id"
  column_alias_for("count(*)")                 # => "count_all"
  column_alias_for("count", "id")              # => "count_id"
Show source
Register or log in to add new notes.