instance method
async_count_by_sql
Ruby on Rails edge
Since v7.1.6Signature
async_count_by_sql(sql)
Same as #count_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise.
Parameters
-
sqlreq
Source
# File activerecord/lib/active_record/querying.rb, line 128
def async_count_by_sql(sql)
with_connection do |c|
c.select_value(_sql_for_find(sql), "#{name} Count", async: true).then(&:to_i)
end
end
Defined in activerecord/lib/active_record/querying.rb line 128
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Querying