AI: address review on PR #477
このコミットが含まれているのは:
@@ -6,6 +6,11 @@ class WikiPagesController < ApplicationController
|
||||
def index
|
||||
locale = resolve_locale!
|
||||
|
||||
resource_type = params[:resource_type]
|
||||
unless resource_type.nil? || ['tag_description', 'tag_group'].include?(resource_type)
|
||||
return head :bad_request
|
||||
end
|
||||
|
||||
title = params[:title].to_s.strip
|
||||
descriptions =
|
||||
HistoryAccess.current(TagDescription.all, TagDescriptionVersion)
|
||||
@@ -14,6 +19,8 @@ class WikiPagesController < ApplicationController
|
||||
|
||||
descriptions = descriptions.order(updated_at: :desc, id: :asc)
|
||||
tag_groups = HistoryAccess.current(TagGroup.all, TagGroupVersion).order(updated_at: :desc, id: :asc)
|
||||
descriptions = descriptions.none if resource_type == 'tag_group'
|
||||
tag_groups = tag_groups.none if resource_type == 'tag_description'
|
||||
if title.present?
|
||||
pattern = "%#{ ApplicationRecord.sanitize_sql_like(title) }%"
|
||||
descriptions =
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする