refactor custom pages seed files
This commit is contained in:
@@ -104,10 +104,7 @@ end
|
||||
|
||||
if SiteCustomization::Page.find_by(slug: "accessibility").nil?
|
||||
page = SiteCustomization::Page.new(slug: "accessibility", status: "published")
|
||||
generate_content(page)
|
||||
I18n.available_locales.each do |locale|
|
||||
I18n.locale = locale
|
||||
translation = page.translations.build(locale: locale)
|
||||
generate_content(translation)
|
||||
I18n.with_locale(locale) { generate_content(page) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,10 +8,7 @@ end
|
||||
if SiteCustomization::Page.find_by(slug: "conditions").nil?
|
||||
page = SiteCustomization::Page.new(slug: "conditions", status: "published")
|
||||
page.print_content_flag = true
|
||||
generate_content(page)
|
||||
I18n.available_locales.each do |locale|
|
||||
I18n.locale = locale
|
||||
translation = page.translations.build(locale: locale)
|
||||
generate_content(translation)
|
||||
I18n.with_locale(locale) { generate_content(page) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,10 +5,7 @@ def generate_content(page)
|
||||
end
|
||||
if SiteCustomization::Page.find_by(slug: "faq").nil?
|
||||
page = SiteCustomization::Page.new(slug: "faq", status: "published")
|
||||
generate_content(page)
|
||||
I18n.available_locales.each do |locale|
|
||||
I18n.locale = locale
|
||||
translation = page.translations.build(locale: locale)
|
||||
generate_content(translation)
|
||||
I18n.with_locale(locale) { generate_content(page) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,10 +7,7 @@ end
|
||||
if SiteCustomization::Page.find_by(slug: "privacy").nil?
|
||||
page = SiteCustomization::Page.new(slug: "privacy", status: "published")
|
||||
page.print_content_flag = true
|
||||
generate_content(page)
|
||||
I18n.available_locales.each do |locale|
|
||||
I18n.locale = locale
|
||||
translation = page.translations.build(locale: locale)
|
||||
generate_content(translation)
|
||||
I18n.with_locale(locale) { generate_content(page) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,10 +19,7 @@ end
|
||||
|
||||
if SiteCustomization::Page.find_by(slug: "welcome_level_three_verified").nil?
|
||||
page = SiteCustomization::Page.new(slug: "welcome_level_three_verified", status: "published")
|
||||
generate_content(page)
|
||||
I18n.available_locales.each do |locale|
|
||||
I18n.locale = locale
|
||||
translation = page.translations.build(locale: locale)
|
||||
generate_content(translation)
|
||||
I18n.with_locale(locale) { generate_content(page) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -24,10 +24,7 @@ def generate_content(page)
|
||||
end
|
||||
if SiteCustomization::Page.find_by(slug: "welcome_level_two_verified").nil?
|
||||
page = SiteCustomization::Page.new(slug: "welcome_level_two_verified", status: "published")
|
||||
generate_content(page)
|
||||
I18n.available_locales.each do |locale|
|
||||
I18n.locale = locale
|
||||
translation = page.translations.build(locale: locale)
|
||||
generate_content(translation)
|
||||
I18n.with_locale(locale) { generate_content(page) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -24,10 +24,7 @@ def generate_content(page)
|
||||
end
|
||||
if SiteCustomization::Page.find_by(slug: "welcome_not_verified").nil?
|
||||
page = SiteCustomization::Page.new(slug: "welcome_not_verified", status: "published")
|
||||
generate_content(page)
|
||||
I18n.available_locales.each do |locale|
|
||||
I18n.locale = locale
|
||||
translation = page.translations.build(locale: locale)
|
||||
generate_content(translation)
|
||||
I18n.with_locale(locale) { generate_content(page) }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user