このコミットが含まれているのは:
@@ -148,4 +148,13 @@ class HistoryAccess < ActiveSupport::CurrentAttributes
|
||||
|
||||
# This number deliberately ignores time, identity and content filters to prevent count probes.
|
||||
def self.population_count(model) = model.unscoped.count
|
||||
|
||||
# Only the resource-wide denied count is public, never a condition-dependent denied count.
|
||||
def self.population_counts(model)
|
||||
total, excluded = model.unscoped.optimizer_hints('MAX_EXECUTION_TIME(10000)').pick(
|
||||
Arel.sql('COUNT(*)'),
|
||||
Arel.sql("COALESCE(SUM(CASE WHEN #{ sql(model) } THEN 0 ELSE 1 END), 0)"))
|
||||
{ population_count: total.to_i, excluded_count: excluded.to_i,
|
||||
excluded_count_scope: 'all_recorded_versions' }
|
||||
end
|
||||
end
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする