Skip to content

Releases: rubocop/rubocop-rails

RuboCop Rails v2.31.0

01 Apr 02:48
Compare
Choose a tag to compare

New features

  • #1471: Support it block parameter in Rails cops. (@koic)

Bug fixes

  • #1465: Avoid warnings about methods of RuboCop::Cop::EnforceSuperclass being redefined. (@davidrunger)

RuboCop Rails v2.30.3

03 Mar 03:07
Compare
Choose a tag to compare

Bug fixes

  • #1458: Fix a false positive for Rails/RelativeDateConstant when assigning a lambda/proc with numblock. (@earlopain)
  • #1457: Fix a false positive for Rails/ReversibleMigration in drop_table with numblock. (@earlopain)
  • #1456: Fix a false positive for Rails/CreateTableWithTimestamps with numblocks. (@earlopain)
  • #1459: Fix a false positive for Rails/UniqBeforePluck when using a numblock with uniq. (@earlopain)
  • #1455: Make Rails/SaveBang aware of numblocks. (@earlopain)
  • #1453: Make Rails/TransactionExitStatement aware of numblocks. (@earlopain)

Changes

  • #1179: Rails/ReflectionClassName: Accept method calls on local variables. (@exterm)
  • #1385: Make Lint/UselessAccessModifier aware of ActiveSupport::Concern and Module#concerning/Module#concern core extensions. (@earlopain)
  • #1454: Disable Rails/Delegate for controllers. (@earlopain)

RuboCop Rails 2.30.2

24 Feb 08:00
Compare
Choose a tag to compare

Bug fixes

  • #1447: Fix false positive for Rails/LexicallyScopedActionFilter when action methods are delegated. (@vlad-pisanov)
  • #1446: Fix false positives for Rails/Delegate when module_function is used. (@ydakuka)
  • #1427: Fix an error for Rails/UniqBeforePluck when pluck and unique are on different lines. (@earlopain)

RuboCop Rails 2.30.1

17 Feb 07:18
Compare
Choose a tag to compare

Bug fixes

  • #1442: Fix an incorrect behavior when using AllCops: TargetRailsVersion. (@koic)
  • #1444: Fix an incorrect behavior when using AllCops: MigratedSchemaVersion. (@koic)

RuboCop Rails 2.30.0

15 Feb 16:53
Compare
Choose a tag to compare

New features

Bug fixes

  • #1071: Fix Rails/FilePath cop to correctly handle File.join with variables and ignore leading and multiple slashes in string literal arguments for Rails.root.join and File.join. (@ydakuka)
  • #912: Enhance Rails/Delegate by adding delegation detection for self.class, constants, class variables, global variables, and instance variables. (@ydakuka)

RuboCop Rails 2.29.1

25 Jan 03:45
Compare
Choose a tag to compare

Bug fixes

  • #1423: Fix an error for Rails/StrongParametersExpect when using permit with no arguments. (@koic)
  • #1417: Fix an incorrect autocorrect for Rails/StrongParametersExpect when using a leading dot multiline call to require with permit. (@koic)
  • #1356: Enhance Rails/DuplicateAssociation to handle alias. (@ydakuka)
  • #1389: Handle TypeError caused by passing array literals as arguments to File methods in Rails/FilePath cop. (@ydakuka)
  • #1389: Handle TypeError caused by passing array literals as arguments to File methods in Rails/RootPathnameMethods cop. (@ydakuka)
  • #1228: Enhance Rails/SaveBang to properly handle instance variables. (@ydakuka)

RuboCop Rails 2.29.0

18 Jan 06:46
Compare
Choose a tag to compare

New features

  • #1407: Add new Rails/MultipleRoutePaths cop. (@koic)
  • #1358: Add new Rails/StrongParametersExpect cop. (@koic)

Bug fixes

  • #1409: Fix an error for Rails/ReversibleMigration when calling drop_table without any arguments. (@earlopain)
  • #1397: Fix an incorrect autocorrect for Rails/TimeZone when Time.new has a string argument. (@mterada1228)
  • #1406: Fix autocorrection for Rails/IndexBy and Rails/IndexWith when map { ... }.to_h is enclosed in another block. (@franzliedke, @eugeneius)
  • #1404: Update Rails/IndexBy and Rails/IndexWith to support numbered block parameters. (@eugeneius)
  • #1405: Fix autocorrection for Rails/IndexWith when the value is a hash literal without braces. (@koic, @eugeneius)
  • #1414: Fix Rails/HttpPositionalArguments cop false positives with arguments forwarding. (@viralpraxis)

Changes

  • #1410: Make registered cops aware of AllCops: MigratedSchemaVersion. (@koic)

RuboCop Rails 2.28.0

25 Dec 09:28
Compare
Choose a tag to compare

New features

  • #1383: Introduce AllCops: MigratedSchemaVersion config. (@koic)

Bug fixes

  • #1390: Fix an incorrect autocorrect for Rails/SelectMap when select has no receiver and method chains are used. (@masato-bkn)
  • #1382: Fix false negatives for Rails/RedundantActiveRecordAllMethod when using all method in block. (@masato-bkn)
  • #1397: Fix Rails/FilePath cop error on join method with implicit receiver. (@viralpraxis)
  • #1398: Fix Rails/FilePath cop error in case of extra operations in Rails.root interpolation. (@viralpraxis)
  • #1392: Fix Rails/FilePath cop error with rescued Rails.root. (@viralpraxis)

Changes

  • #1388: Modify Rails/Pluck to ignore map/collect when used inside blocks to prevent potential N+1 queries. (@masato-bkn)

RuboCop Rails 2.27.0

26 Oct 08:17
Compare
Choose a tag to compare

Bug fixes

  • #1377: Fix an error for Rails/EnumSyntax when positional arguments are used and options are not passed as keyword arguments. (@koic)
  • #1367: Fix Rails/TimeZone should not report offense on String#to_time with timezone specifier. (@armandmgt)

Changes

  • #727: Disable Rails/TransactionExitStatement on Rails >= 7.2. (@earlopain)
  • #1374: Change Rails/EnvLocal to handle negated conditions. (@fatkodima)
  • #1195: Change Rails/SelectMap to handle safe navigation operators. (@fatkodima)

RuboCop Rails 2.26.2

21 Sep 03:52
Compare
Choose a tag to compare

Bug fixes

  • #1362: Fix false positives for Rails/EnumSyntax when using Ruby 2.7. (@koic)
  • #1269: Fix false positives for Rails/ActionControllerFlashBeforeRender in combination with implicit returns. (@earlopain)
  • #1326: Fix wrong autocorrect for Rails/FilePath when passing an array to File.join. (@earlopain)

Changes