2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-18 16:09:13 -04:00
|
|
|
if !Rails.env.test?
|
2020-06-17 01:23:45 -04:00
|
|
|
require 'seed_data/topics'
|
|
|
|
|
2019-03-18 16:09:13 -04:00
|
|
|
topics_exist = Topic.where(<<~SQL).exists?
|
|
|
|
id NOT IN (
|
|
|
|
SELECT topic_id
|
|
|
|
FROM categories
|
|
|
|
WHERE topic_id IS NOT NULL
|
|
|
|
)
|
|
|
|
SQL
|
|
|
|
|
|
|
|
SeedData::Topics.with_default_locale.create(include_welcome_topics: !topics_exist)
|
2014-07-29 14:30:23 -04:00
|
|
|
end
|