conditions translations in seed are being generated
This commit is contained in:
@@ -1,8 +1,17 @@
|
|||||||
if SiteCustomization::Page.find_by(slug: "conditions").nil?
|
def generate_content(page)
|
||||||
page = SiteCustomization::Page.new(slug: "conditions", status: "published")
|
|
||||||
page.print_content_flag = true
|
|
||||||
page.title = I18n.t("pages.conditions.title")
|
page.title = I18n.t("pages.conditions.title")
|
||||||
page.subtitle = I18n.t("pages.conditions.subtitle")
|
page.subtitle = I18n.t("pages.conditions.subtitle")
|
||||||
page.content = "<p>#{I18n.t("pages.conditions.description")}</p>"
|
page.content = "<p>#{I18n.t("pages.conditions.description")}</p>"
|
||||||
page.save!
|
page.save!
|
||||||
end
|
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)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user