ruby on rails - ActiveRecord customize "AS" identifier -
some rails code like:
@result = table_one.join(table_two, table_three). where(id = '1'). group(:val1, :val2, :amount). sum(:amount)
will execute sql like:
select sum(table_one.amount) table_one_amount, table_one.val1 table_one_val1 ....
just wondering if there way customize rule of "as", can sql like
select sum(table_one.amount) t1_a, table_one.val1 t1_v1 ....
Comments
Post a Comment