このコミットが含まれているのは:
@@ -15,6 +15,17 @@
|
||||
- 履歴読み取りは HistoryAccess の共通認可を必須とする。書込用 relation を公開しない。
|
||||
export は生成時と取得時に認可し、権限変更・除票後に古いファイルを再利用しない。
|
||||
|
||||
## Mandatory naming contract
|
||||
|
||||
- ルート `AGENTS.md` の必須命名規約を適用する。メソッド等の callable 以外の
|
||||
自前識別子に動詞を使わず、形容詞の状態名、名詞の真偽値には `_flg` を使用する。
|
||||
例:`is_latest` は `latest`、`is_admin` は `admin_flg`。
|
||||
- 引数、属性、SQL alias、API・URL パラメータ、JSON キー、DB カラムも対象とする。
|
||||
Rails 等が定義する外部 API 名や、処理を実行するメソッド名は変更しない。
|
||||
- 旧 API・URL の互換性は解析・シリアライズ境界で扱い、内部定義は新名に統一する。
|
||||
DB カラムの改名はデータを保持する追加マイグレーションで設計し、適用済みの
|
||||
マイグレーションを書き換えない。マイグレーションの実行には個別指示を要する。
|
||||
|
||||
## Scope
|
||||
|
||||
These rules apply to work under `backend/`.
|
||||
|
||||
@@ -43,12 +43,9 @@ class CountsTableQuery
|
||||
ApplicationRecord.transaction do
|
||||
result = metadata.merge(mode == 'summary' ? summary : details)
|
||||
visible = mode == 'summary' ? result[:visible_output_count] : result[:count]
|
||||
# A scalar result has one row regardless of private attributes or predicates.
|
||||
public_count = result[:excluded_count].zero? || (mode == 'summary' && axes.rows.empty?)
|
||||
result.merge(visible_output_count: visible,
|
||||
output_count: public_count ? visible : nil,
|
||||
output_count_scope: public_count ?
|
||||
'before_authorisation' : 'unavailable_private_history',
|
||||
output_count: visible,
|
||||
output_count_scope: 'authorised_results',
|
||||
output_count_unit: 'table_body_rows',
|
||||
page_grand_total_repeated: mode == 'summary' && axes.rows.any? &&
|
||||
result[:group_count] > limit)
|
||||
@@ -57,7 +54,12 @@ class CountsTableQuery
|
||||
|
||||
def metadata
|
||||
@population_counts ||= HistoryAccess.population_counts(@definition.model)
|
||||
# Global exclusions are not exclusions for this filtered query. Do not expose
|
||||
# private predicate matches through a condition-dependent count.
|
||||
exclusions_known = @population_counts[:excluded_count].zero?
|
||||
@population_counts.merge(
|
||||
excluded_count: exclusions_known ? 0 : nil,
|
||||
excluded_count_scope: exclusions_known ? 'current_query' : 'unavailable_private_history',
|
||||
population_count_scope: 'all_recorded_versions',
|
||||
page:, limit:, execution_at: population.at.iso8601(6), at: @params['at'].presence,
|
||||
definition: population.history ? 'history' : 'latest',
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする