locale.rb 340 B

123456789101112
  1. FactoryBot.define do
  2. factory 'knowledge_base/locale', aliases: %i[knowledge_base_locale] do
  3. knowledge_base { nil }
  4. system_locale { Locale.first || create(:locale) }
  5. before :create do |kb_locale|
  6. if kb_locale.knowledge_base.blank?
  7. create(:knowledge_base, given_kb_locale: kb_locale)
  8. end
  9. end
  10. end
  11. end