このコミットが含まれているのは:
2026-10-27 18:49:58 +09:00
コミット f9f31812a9
22個のファイルの変更、201行の追加、59行の削除
+5 -5
ファイルの表示
@@ -13,7 +13,7 @@ class CountsCondition
path_labels = labels + [field[:label]]
type = if prefix
CHILD_TYPES.fetch(field[:key], :string)
elsif key == 'is_latest'
elsif key == 'latest'
:boolean
elsif key == 'parents'
:integer
@@ -27,7 +27,7 @@ class CountsCondition
type = :string if field[:children] || type == :json
type = :integer if ['parents', 'members'].include?(key)
physical = result.find { _1[:key] == key }
nullable = prefix.present? || (physical ? physical[:nullable] : key != 'is_latest')
nullable = prefix.present? || (physical ? physical[:nullable] : key != 'latest')
nullable = false if field[:children]
entry = { key:, type:, labels: path_labels, nullable:,
multiple: prefix.present? || field[:children].present?,
@@ -204,7 +204,7 @@ class CountsCondition
bound = @connection.quote(point)
source += ' LEFT JOIN tag_versions parent_version ON parent_version.tag_id = ' + id +
" AND parent_version.created_at <= #{ bound } AND " +
HistoryAccess.sql(TagVersion, 'parent_version') +
@population.access_sql(TagVersion, 'parent_version') +
' AND NOT EXISTS (SELECT 1 FROM tag_versions newer_parent ' +
'WHERE newer_parent.tag_id = parent_version.tag_id ' +
"AND newer_parent.created_at <= #{ bound } " +
@@ -218,7 +218,7 @@ class CountsCondition
scalar('tag_snapshot.item', 'tag_id', :integer) +
' AND referenced_tag.version_no = ' + scalar('tag_snapshot.item', 'version_no', :integer) +
" AND referenced_tag.created_at <= #{ @connection.quote(point) } AND " +
HistoryAccess.sql(TagVersion, 'referenced_tag')
@population.access_sql(TagVersion, 'referenced_tag')
source
end
@@ -242,7 +242,7 @@ class CountsCondition
def source_for(key)
root, *parts = key.split('.')
return [nil, "(#{ @population.latest_sql })"] if root == 'is_latest'
return [nil, "(#{ @population.latest_sql })"] if root == 'latest'
if root == 'user' && parts.any?
expression = parts.first == 'id' ? 'v.created_by_user_id' :
'(SELECT actor.name FROM users actor WHERE actor.id = v.created_by_user_id)'