diff options
author | Roque Pinel <repinel@gmail.com> | 2015-06-21 15:46:08 -0400 |
---|---|---|
committer | Roque Pinel <repinel@gmail.com> | 2015-06-30 17:36:51 -0500 |
commit | b220c9f9b4cc5b17af40b09046501f3469929a11 (patch) | |
tree | a163a761ea0bdacf428b3c7dbe7ecc5fd57a49d3 /guides/source/active_record_postgresql.md | |
parent | bc6ac8609cf79f28047c0928b9433e00e6ea1f09 (diff) | |
download | rails-b220c9f9b4cc5b17af40b09046501f3469929a11.tar.gz rails-b220c9f9b4cc5b17af40b09046501f3469929a11.tar.bz2 rails-b220c9f9b4cc5b17af40b09046501f3469929a11.zip |
Allow select with Arel and count as well as calculations with Arel
It allows a query like `User.select(:name).count` to be written
using Arel as `User.select(User.arel_table[:name]).count`.
It exposes the calculations API to accept Arel nodes:
`User.count(User.arel_table[:name])`, `User.sum(User.arel_table[:id])`,
`Account.average(Account.arel_table[:credit_limit])`,
`Account.maximum(Account.arel_table[:credit_limit])` and
`Account.minimum(Account.arel_table[:credit_limit])`.
Diffstat (limited to 'guides/source/active_record_postgresql.md')
0 files changed, 0 insertions, 0 deletions