Files
nairobi/db/pages/conditions.rb
Javi Martín 49e55b4dc4 Apply Rails/DynamicFindBy rubocop rule
We were already using `find_by` most of the time.

Since there are false positives related to our `find_by_slug_or_id!` and
`find_by_manger_login` methods, which cannot be replaced with `find_by`,
I'm adding it indicating the "refactor" severity.
2019-10-23 20:05:40 +02:00

9 lines
358 B
Ruby

if SiteCustomization::Page.find_by(slug: "conditions").nil?
page = SiteCustomization::Page.new(slug: "conditions", status: "published")
page.print_content_flag = true
page.title = I18n.t("pages.conditions.title")
page.subtitle = I18n.t("pages.conditions.subtitle")
page.content = "<p>#{I18n.t("pages.conditions.description")}</p>"
page.save!
end