Wiki 依存の排除 (#431) (#432)

Reviewed-on: #432
Co-authored-by: miteruzo <miteruzo@naver.com>
このコミットはプルリクエスト #432 でマージされました。
このコミットが含まれているのは:
2026-10-16 00:26:53 +09:00
committed by みてるぞ
コミット 75d7dac999
75個のファイルの変更、1474行の追加、3000行の削除
+2
ファイルの表示
@@ -6,6 +6,8 @@ FactoryBot.define do
auto_generated { false }
sequence(:name) { |number| "tag-#{ SecureRandom.hex(4) }-#{ number }" }
association :tag, primary_tag_name: nil
trait :alias do
primary_flg { false }
end
+6 -7
ファイルの表示
@@ -4,7 +4,7 @@ FactoryBot.define do
primary_name { nil }
primary_tag_name do
attributes = primary_name.nil? ? { } : { name: primary_name }
build(:tag_name, **attributes)
build(:tag_name, tag: nil, **attributes)
end
end
@@ -12,17 +12,16 @@ FactoryBot.define do
post_count { 0 }
after(:build) do |tag, evaluator|
next unless evaluator.primary_tag_name
evaluator.primary_tag_name.primary_flg = true
evaluator.primary_tag_name.tag = tag
tag.tag_names.target << evaluator.primary_tag_name
end
before(:create) do |tag, evaluator|
evaluator.primary_tag_name.save!
# Compatibility write only; ownership is established through tag_id below.
tag.tag_name_id = evaluator.primary_tag_name.id
end
after(:create) do |tag, evaluator|
next unless evaluator.primary_tag_name
evaluator.primary_tag_name.update!(tag:, primary_flg: true)
Locale.where(deprecated_at: nil).order(:language_code, :created_at, :script_code).to_a
-9
ファイルの表示
@@ -1,9 +0,0 @@
FactoryBot.define do
factory :wiki_page do
title { "TestPage" }
association :created_user, factory: :user
association :updated_user, factory: :user
body { ' ' }
end
end