Tweak the docs for async_*
APIs [ci skip]
This PR adds period at the end of sentences to maintain consistency in the `async_*` API document.
This commit is contained in:
parent
ef21ab6a88
commit
0bdf160f3a
@ -51,7 +51,7 @@ def find_by_sql(sql, binds = [], preparable: nil, &block)
|
||||
_load_from_sql(_query_by_sql(sql, binds, preparable: preparable), &block)
|
||||
end
|
||||
|
||||
# Same as <tt>#find_by_sql</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#find_by_sql</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_find_by_sql(sql, binds = [], preparable: nil, &block)
|
||||
_query_by_sql(sql, binds, preparable: preparable, async: true).then do |result|
|
||||
_load_from_sql(result, &block)
|
||||
@ -102,7 +102,7 @@ def count_by_sql(sql)
|
||||
connection.select_value(sanitize_sql(sql), "#{name} Count").to_i
|
||||
end
|
||||
|
||||
# Same as <tt>#count_by_sql</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#count_by_sql</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_count_by_sql(sql)
|
||||
connection.select_value(sanitize_sql(sql), "#{name} Count", async: true).then(&:to_i)
|
||||
end
|
||||
|
@ -93,7 +93,7 @@ def count(column_name = nil)
|
||||
end
|
||||
end
|
||||
|
||||
# Same as <tt>#count</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#count</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_count(column_name = nil)
|
||||
async.count(column_name)
|
||||
end
|
||||
@ -106,7 +106,7 @@ def average(column_name)
|
||||
calculate(:average, column_name)
|
||||
end
|
||||
|
||||
# Same as <tt>#average</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#average</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_average(column_name)
|
||||
async.average(column_name)
|
||||
end
|
||||
@ -120,7 +120,7 @@ def minimum(column_name)
|
||||
calculate(:minimum, column_name)
|
||||
end
|
||||
|
||||
# Same as <tt>#minimum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#minimum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_minimum(column_name)
|
||||
async.minimum(column_name)
|
||||
end
|
||||
@ -134,7 +134,7 @@ def maximum(column_name)
|
||||
calculate(:maximum, column_name)
|
||||
end
|
||||
|
||||
# Same as <tt>#maximum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#maximum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_maximum(column_name)
|
||||
async.maximum(column_name)
|
||||
end
|
||||
@ -152,7 +152,7 @@ def sum(initial_value_or_column = 0, &block)
|
||||
end
|
||||
end
|
||||
|
||||
# Same as <tt>#sum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#sum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_sum(identity_or_column = nil)
|
||||
async.sum(identity_or_column)
|
||||
end
|
||||
@ -287,7 +287,7 @@ def pluck(*column_names)
|
||||
end
|
||||
end
|
||||
|
||||
# Same as <tt>#pluck</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#pluck</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_pluck(*column_names)
|
||||
async.pluck(*column_names)
|
||||
end
|
||||
@ -315,7 +315,7 @@ def pick(*column_names)
|
||||
limit(1).pluck(*column_names).then(&:first)
|
||||
end
|
||||
|
||||
# Same as <tt>#pick</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#pick</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_pick(*column_names)
|
||||
async.pick(*column_names)
|
||||
end
|
||||
@ -358,7 +358,7 @@ def ids
|
||||
result.then { |result| type_cast_pluck_values(result, columns) }
|
||||
end
|
||||
|
||||
# Same as <tt>#ids</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
||||
# Same as <tt>#ids</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
||||
def async_ids
|
||||
async.ids
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user