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.
7 lines
263 B
Ruby
7 lines
263 B
Ruby
if SiteCustomization::Page.find_by(slug: "faq").nil?
|
|
page = SiteCustomization::Page.new(slug: "faq", status: "published")
|
|
page.title = I18n.t("pages.help.faq.page.title")
|
|
page.content = "<p>#{I18n.t("pages.help.faq.page.description")}</p>"
|
|
page.save!
|
|
end
|