Remove duplication creating web sections in seeds
This commit is contained in:
@@ -19,10 +19,4 @@ section "Creating banners" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
section "Creating web sections" do
|
load Rails.root.join("db", "web_sections.rb")
|
||||||
WebSection.create!(name: "homepage")
|
|
||||||
WebSection.create!(name: "debates")
|
|
||||||
WebSection.create!(name: "proposals")
|
|
||||||
WebSection.create!(name: "budgets")
|
|
||||||
WebSection.create!(name: "help_page")
|
|
||||||
end
|
|
||||||
|
|||||||
@@ -7,12 +7,7 @@ if Administrator.count == 0 && !Rails.env.test?
|
|||||||
end
|
end
|
||||||
|
|
||||||
Setting.reset_defaults
|
Setting.reset_defaults
|
||||||
|
load Rails.root.join("db", "web_sections.rb")
|
||||||
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!
|
|
||||||
|
|
||||||
# Default custom pages
|
# Default custom pages
|
||||||
load Rails.root.join("db", "pages.rb")
|
load Rails.root.join("db", "pages.rb")
|
||||||
|
|||||||
5
db/web_sections.rb
Normal file
5
db/web_sections.rb
Normal file
@@ -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!
|
||||||
Reference in New Issue
Block a user