diff --git a/db/dev_seeds/banners.rb b/db/dev_seeds/banners.rb index 1b208fa48..61cfbb00e 100644 --- a/db/dev_seeds/banners.rb +++ b/db/dev_seeds/banners.rb @@ -19,10 +19,4 @@ section "Creating banners" do end end -section "Creating web sections" do - WebSection.create!(name: "homepage") - WebSection.create!(name: "debates") - WebSection.create!(name: "proposals") - WebSection.create!(name: "budgets") - WebSection.create!(name: "help_page") -end +load Rails.root.join("db", "web_sections.rb") diff --git a/db/seeds.rb b/db/seeds.rb index dba4e37cb..28704c29d 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -7,12 +7,7 @@ if Administrator.count == 0 && !Rails.env.test? end Setting.reset_defaults - -WebSection.where(name: "homepage").first_or_create! -WebSection.where(name: "debates").first_or_create! -WebSection.where(name: "proposals").first_or_create! -WebSection.where(name: "budgets").first_or_create! -WebSection.where(name: "help_page").first_or_create! +load Rails.root.join("db", "web_sections.rb") # Default custom pages load Rails.root.join("db", "pages.rb") diff --git a/db/web_sections.rb b/db/web_sections.rb new file mode 100644 index 000000000..57b8a915a --- /dev/null +++ b/db/web_sections.rb @@ -0,0 +1,5 @@ +WebSection.where(name: "homepage").first_or_create! +WebSection.where(name: "debates").first_or_create! +WebSection.where(name: "proposals").first_or_create! +WebSection.where(name: "budgets").first_or_create! +WebSection.where(name: "help_page").first_or_create!