Select Value For SQL Counts
> sql = 'select count(*) from posts where published_at is not null'
=> "select count(*) from posts where published_at is not null"
> ActiveRecord::Base.connection.select_value(sql).to_i
(0.6ms) select count(*) from posts where published_at is not null
=> 42Last updated