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.
This commit is contained in:
Javi Martín
2019-10-23 20:05:40 +02:00
parent 93c6347b45
commit 49e55b4dc4
12 changed files with 16 additions and 12 deletions

View File

@@ -25,7 +25,7 @@ describe "Admin custom pages" do
expect(SiteCustomization::Page.count).to be 7
slugs.each do |slug|
expect(SiteCustomization::Page.find_by_slug(slug).status).to eq "published"
expect(SiteCustomization::Page.find_by(slug: slug).status).to eq "published"
end
expect(all("[id^='site_customization_page_']").count).to be 7