Skip to content

Commit

Permalink
Upgrade: Bump rubocop-rails from 2.25.1 to 2.26.0 (#4785)
Browse files Browse the repository at this point in the history
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from
2.25.1 to 2.26.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rubocop/rubocop-rails/releases">rubocop-rails's
releases</a>.</em></p>
<blockquote>
<h2>RuboCop Rails 2.26.0</h2>
<h3>New features</h3>
<ul>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1238">#1238</a>:
Add new <code>Rails/EnumSyntax</code> cop. (<a
href="https://github.com/maxprokopiev"><code>@​maxprokopiev</code></a>,
<a href="https://github.com/koic"><code>@​koic</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1309">#1309</a>:
Support Rails 7 syntax for <code>Rails/EnumHash</code> cop. (<a
href="https://github.com/ytjmt"><code>@​ytjmt</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1298">#1298</a>:
Support Rails 7 syntax for <code>Rails/EnumUniqueness</code> cop. (<a
href="https://github.com/ytjmt"><code>@​ytjmt</code></a>)</li>
</ul>
<h3>Bug fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1335">#1335</a>:
Fix an error for <code>Rails/BulkChangeTable</code> when the block for
<code>change_table</code> is empty. (<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1325">#1325</a>:
Fix an error for <code>Rails/RenderPlainText</code> when the content
type is passed as a constant. (<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1337">#1337</a>:
Fix an error for <code>Rails/Validation</code> when passing no
arguments. (<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1330">#1330</a>:
Fix an error for <code>Rails/WhereNot</code> when using placeholder
without second argument. (<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1311">#1311</a>:
Fix false negatives for
<code>Rails/ActionControllerFlashBeforeRender</code> when using implicit
render or rescue blocks. (<a
href="https://github.com/tldn0718"><code>@​tldn0718</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1313">#1313</a>:
Fix false positives for <code>Rails/CompactBlank</code> when using
<code>collection.reject!</code>. (<a
href="https://github.com/koic"><code>@​koic</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1319">#1319</a>:
Fix a false positive for
<code>Rails/RedundantPresenceValidationOnBelongsTo</code> when removing
<code>presence</code> would leave other non-validation options like
<code>allow_blank</code> without validations. (<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1306">#1306</a>:
Make <code>Rails/PluralizationGrammar</code> aware of byte methods. (<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1302">#1302</a>:
Allow <code>params</code> receiver by default for
<code>Style/CollectionMethods</code>. (<a
href="https://github.com/koic"><code>@​koic</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1321">#1321</a>:
Fix an error for <code>Rails/WhereEquals</code> when the second argument
is not yet typed (<code>where(&quot;foo = ?&quot;, )</code>). (<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>)</li>
</ul>
<h3>Changes</h3>
<ul>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1308">#1308</a>:
Change <code>Rails/CompactBlank</code> to handle
<code>select(&amp;:present?)</code>. (<a
href="https://github.com/fatkodima"><code>@​fatkodima</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1303">#1303</a>:
Change <code>Rails/IgnoredSkipActionFilterOption</code> to handle
multiple callbacks. (<a
href="https://github.com/fatkodima"><code>@​fatkodima</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1199">#1199</a>:
Make <code>Rails/WhereEquals</code> aware of
<code>where.not(...)</code>. (<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>)</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1003">#1003</a>:
Change <code>Rails/RootPathnameMethods</code> to detect offenses on
<code>Dir.[]</code>. (<a
href="https://github.com/r7kamura"><code>@​r7kamura</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md">rubocop-rails's
changelog</a>.</em></p>
<blockquote>
<h2>2.26.0 (2024-08-24)</h2>
<h3>New features</h3>
<ul>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1238">#1238</a>:
Add new <code>Rails/EnumSyntax</code> cop. ([<a
href="https://github.com/maxprokopiev"><code>@​maxprokopiev</code></a>][],
[<a href="https://github.com/koic"><code>@​koic</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1309">#1309</a>:
Support Rails 7 syntax for <code>Rails/EnumHash</code> cop. ([<a
href="https://github.com/ytjmt"><code>@​ytjmt</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1298">#1298</a>:
Support Rails 7 syntax for <code>Rails/EnumUniqueness</code> cop. ([<a
href="https://github.com/ytjmt"><code>@​ytjmt</code></a>][])</li>
</ul>
<h3>Bug fixes</h3>
<ul>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1335">#1335</a>:
Fix an error for <code>Rails/BulkChangeTable</code> when the block for
<code>change_table</code> is empty. ([<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1325">#1325</a>:
Fix an error for <code>Rails/RenderPlainText</code> when the content
type is passed as a constant. ([<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1337">#1337</a>:
Fix an error for <code>Rails/Validation</code> when passing no
arguments. ([<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1330">#1330</a>:
Fix an error for <code>Rails/WhereNot</code> when using placeholder
without second argument. ([<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1311">#1311</a>:
Fix false negatives for
<code>Rails/ActionControllerFlashBeforeRender</code> when using implicit
render or rescue blocks. ([<a
href="https://github.com/tldn0718"><code>@​tldn0718</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1313">#1313</a>:
Fix false positives for <code>Rails/CompactBlank</code> when using
<code>collection.reject!</code>. ([<a
href="https://github.com/koic"><code>@​koic</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1319">#1319</a>:
Fix a false positive for
<code>Rails/RedundantPresenceValidationOnBelongsTo</code> when removing
<code>presence</code> would leave other non-validation options like
<code>allow_blank</code> without validations. ([<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1306">#1306</a>:
Make <code>Rails/PluralizationGrammar</code> aware of byte methods. ([<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1302">#1302</a>:
Allow <code>params</code> receiver by default for
<code>Style/CollectionMethods</code>. ([<a
href="https://github.com/koic"><code>@​koic</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1321">#1321</a>:
Fix an error for <code>Rails/WhereEquals</code> when the second argument
is not yet typed (<code>where(&quot;foo = ?&quot;, )</code>). ([<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>][])</li>
</ul>
<h3>Changes</h3>
<ul>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1308">#1308</a>:
Change <code>Rails/CompactBlank</code> to handle
<code>select(&amp;:present?)</code>. ([<a
href="https://github.com/fatkodima"><code>@​fatkodima</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1303">#1303</a>:
Change <code>Rails/IgnoredSkipActionFilterOption</code> to handle
multiple callbacks. ([<a
href="https://github.com/fatkodima"><code>@​fatkodima</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1199">#1199</a>:
Make <code>Rails/WhereEquals</code> aware of
<code>where.not(...)</code>. ([<a
href="https://github.com/earlopain"><code>@​earlopain</code></a>][])</li>
<li><a
href="https://redirect.github.com/rubocop/rubocop-rails/pull/1003">#1003</a>:
Change <code>Rails/RootPathnameMethods</code> to detect offenses on
<code>Dir.[]</code>. ([<a
href="https://github.com/r7kamura"><code>@​r7kamura</code></a>][])</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/334861ea2a0b345e347c30aa97283b690713b672"><code>334861e</code></a>
Cut 2.26.0</li>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/91c0f30412b7058c5ad8bede8554045f99073294"><code>91c0f30</code></a>
Update Changelog</li>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/6bc9b1ccafd4a64fd00a9445e9ad83e9c7531b7e"><code>6bc9b1c</code></a>
Merge pull request <a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1337">#1337</a>
from Earlopain/validation-error</li>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/aa2bf3e2903268f5d9a2fde05f0baa770d568fdf"><code>aa2bf3e</code></a>
Merge pull request <a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1336">#1336</a>
from koic/add_new_rails_enum_syntax_cop</li>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/d17c7b56c7190437af24b68addcd851650a145e8"><code>d17c7b5</code></a>
Merge pull request <a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1309">#1309</a>
from ytjmt/support-new-enum-syntax-for-enum-hash-cop</li>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/2201bd878520b25fd9ee04f691dd38ff9021c664"><code>2201bd8</code></a>
[Fix <a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1238">#1238</a>]
Add new <code>Rails/EnumSyntax</code> cop</li>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/ebd652ff12ba4c34b5ea06d5b29b0764c4f1ff5f"><code>ebd652f</code></a>
Merge pull request <a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1335">#1335</a>
from Earlopain/error-bulk-change-table</li>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/5e2237a83ecd3b0277ec9e1ef96ee257af6681d5"><code>5e2237a</code></a>
Fix an error for <code>Rails/Validation</code> when passing no
arguments</li>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/a9db5f52d18e0458694ee38950c78c639ea6cd50"><code>a9db5f5</code></a>
Update <code>Rails/Validation</code> specs to modern style</li>
<li><a
href="https://github.com/rubocop/rubocop-rails/commit/75be327042c6db0229f358baa37e8b09d609695c"><code>75be327</code></a>
Merge pull request <a
href="https://redirect.github.com/rubocop/rubocop-rails/issues/1334">#1334</a>
from Earlopain/cop-registry-deprecated</li>
<li>Additional commits viewable in <a
href="https://github.com/rubocop/rubocop-rails/compare/v2.25.1...v2.26.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rubocop-rails&package-manager=bundler&previous-version=2.25.1&new-version=2.26.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kevin <[email protected]>
  • Loading branch information
dependabot[bot] and KevinMulhern authored Aug 27, 2024
1 parent 2410bfa commit 5cd4c75
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ group :development do
gem 'rack-mini-profiler'
gem 'rubocop', '~> 1.61', require: false
gem 'rubocop-performance', '~> 1.19', require: false
gem 'rubocop-rails', '~> 2.25', require: false
gem 'rubocop-rails', '~> 2.26', require: false
gem 'rubocop-rspec', '~> 2.25', require: false
gem 'web-console', '~> 4.2'
end
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ GEM
omniauth (~> 2.0)
orm_adapter (0.5.0)
pagy (9.0.5)
parallel (1.26.1)
parallel (1.26.3)
parallel_tests (4.7.1)
parallel
parser (3.3.4.2)
Expand Down Expand Up @@ -482,7 +482,7 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.0)
rubocop-ast (1.32.1)
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
Expand All @@ -491,10 +491,10 @@ GEM
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.25.1)
rubocop-rails (2.26.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.31.0)
rubocop (~> 1.40)
Expand Down Expand Up @@ -647,7 +647,7 @@ DEPENDENCIES
rspec_junit_formatter (~> 0.6)
rubocop (~> 1.61)
rubocop-performance (~> 1.19)
rubocop-rails (~> 2.25)
rubocop-rails (~> 2.26)
rubocop-rspec (~> 2.25)
ruby-progressbar (~> 1.13)
scenic (~> 1.8)
Expand Down
4 changes: 2 additions & 2 deletions app/models/flag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class Flag < ApplicationRecord
validates :resolved_by_id, presence: true, if: -> { status == 'resolved' }

enum reason: REASONS.each_with_object({}) { |reason, hash| hash[reason.name] = reason.value }
enum status: { active: 0, resolved: 1 }
enum action_taken: { pending: 0, dismiss: 1, ban: 2, removed_project_submission: 3, notified_user: 4 }
enum :status, { active: 0, resolved: 1 }
enum :action_taken, { pending: 0, dismiss: 1, ban: 2, removed_project_submission: 3, notified_user: 4 }

scope :by_status, ->(status) { where(status:) }
scope :count_for, ->(status) { by_status(status).count }
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
abort('The Rails environment is running in production mode!') if Rails.env.production?
require 'rspec/rails'

Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
Rails.root.glob('spec/support/**/*.rb').each { |f| require f }
ActiveRecord::Migration[6.0].maintain_test_schema!

require 'dotenv'
Expand Down

0 comments on commit 5cd4c75

Please sign in to comment.