Skip to content

smellsblue/rails-counting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

To use this gem, simply include it in your Gemfile and invoke it as so:

results = MyModel.select("something AS something_else").counting { |arel| arel.except(:select) }
# Invokes the block so the select clause is removed, avoiding a bug in Rails.
size = results.count
# Includes the select as desired.
values = results.load

About

Utility to define custom logic when running .count on an AREL object.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages