このコミットが含まれているのは:
2026-11-07 18:34:17 +09:00
コミット 520ffa4c4c
6個のファイルの変更、117行の追加、16行の削除
+1 -2
ファイルの表示
@@ -15,7 +15,6 @@ class PostVersionsController < ApplicationController
offset = (page - 1) * limit
q = HistoryAccess.visible(PostVersion.all)
q = q.with_previous_version if tag_id || external_tag_id
q = q.where('post_versions.post_id = ?', post_id) if post_id
q = q.with_previous_version if tag_id || external_tag_id
if external_tag_id || (tag_id && !(Tag.exists?(id: tag_id)))
@@ -34,7 +33,7 @@ class PostVersionsController < ApplicationController
.limit(limit)
.offset(offset)
.pluck('post_versions.id')
versions = HistoryAccess.visible(version_scope.where(id: ids))
versions = version_scope.merge(q).where(id: ids)
.order(Arel.sql('post_versions.created_at DESC, post_versions.id DESC'))
render json: { versions: serialise_versions(versions, locale.language_code), count:, population_count: HistoryAccess.population_count(PostVersion) }