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.
8 lines
277 B
Ruby
8 lines
277 B
Ruby
if SiteCustomization::Page.find_by(slug: "privacy").nil?
|
|
page = SiteCustomization::Page.new(slug: "privacy", status: "published")
|
|
page.print_content_flag = true
|
|
page.title = I18n.t("pages.privacy.title")
|
|
page.content = I18n.t("pages.privacy.subtitle")
|
|
page.save!
|
|
end
|