From 885a9ad7657eae230d41a2c48549f58d815be354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 14 Jan 2021 14:51:31 +0100 Subject: [PATCH] Simplify creating web sections in seeds --- db/web_sections.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/db/web_sections.rb b/db/web_sections.rb index 57b8a915a..9683621e9 100644 --- a/db/web_sections.rb +++ b/db/web_sections.rb @@ -1,5 +1,3 @@ -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! +%w[homepage debates proposals budgets help_page].each do |section| + WebSection.where(name: section).first_or_create! +end