2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-18 18:13:47 -04:00
|
|
|
require 'seed_data/topics'
|
|
|
|
|
2013-12-15 20:46:46 -05:00
|
|
|
User.reset_column_information
|
|
|
|
Topic.reset_column_information
|
|
|
|
Post.reset_column_information
|
|
|
|
|
2019-03-18 16:09:13 -04:00
|
|
|
if !Rails.env.test?
|
|
|
|
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
|