Skip to content

Releases: rubocop/rubocop-rails

RuboCop Rails v2.34.0

16 Nov 07:35

Choose a tag to compare

New features

  • #1520: New Rails/HttpStatusNameConsistency cop. (@tuxagon)
  • #1376: Add new Rails/Env cop. (@cdudas17)
  • #1541: Add new Rails/RedirectBackOrTo cop to suggest using redirect_back_or_to instead of redirect_back with fallback_location. (@davidenglishmusic)

Bug fixes

  • #1539: Fix an error in Rails/ActionControllerFlashBeforeRender when flash is used inside a block followed by method chaining. (@koic)
  • #1553: Fix false positives for Rails/OutputSafety when using non-interpolated multiline heredoc. (@koic)
  • #1532: Fix false positives for Rails/FindByOrAssignmentMemoization when assigning a memoization instance variable at initialize method. (@koic)
  • #1549: Fix Rails/InverseOf cop false positives when using dynamic association options. (@viralpraxis)

Changes

RuboCop Rails v2.33.4

27 Sep 06:27

Choose a tag to compare

Bug fixes

  • #1530: Fix an incorrect autocorrect for Rails/FindByOrAssignmentMemoization when using endless method definition. (@koic)
  • #1522: Fix an error for Rails/FindBy when where takes a block. (@earlopain)
  • #1182: Fix a false positive for Rails/ActionControllerFlashBeforeRender when flash is called in a block. (@5hun-s)

RuboCop Rails v2.33.3

13 Aug 15:19

Choose a tag to compare

Bug fixes

  • #1516: Fix wrong autocorrect for Rails/FindByOrAssignmentMemoization. (@earlopain)

RuboCop Rails v2.33.2

13 Aug 08:46

Choose a tag to compare

Bug fixes

  • #1488: Fix an error for Rails/ReadWriteAttribute with a frozen string attribute name. (@viralpraxis)

RuboCop Rails v2.33.1

11 Aug 22:52

Choose a tag to compare

Bug fixes

  • #1508: Fix an error for Rails/TransactionExitStatement when transaction is part of a method chain. (@earlopain)
  • #1510: Fix Rails/OrderArguments cop false positives when using column index argument. (@viralpraxis)
  • #1511: Don't register offenses for Rails/WhereExists when exists? is given multiple or splat arguments. (@lovro-bikic)

RuboCop Rails v2.33.0

10 Aug 03:27

Choose a tag to compare

New features

Bug fixes

  • #1497: Fix bugs in Rails/PluckId and Rails/PluckInWhere. (@r7kamura)
  • #1478: Fix a false negative for Rails/EnvLocal when having preceding conditions. (@fatkodima)
  • #1505: Fix false negatives for Rails/Pluck when map method call is used in a block without a receiver. (@koic)
  • #1486: Fix false positives for Rails/Output when p method is a DSL. (@koic)
  • #1495: Fix false positives for Rails/TransactionExitStatement when break is used in loop in transactions. (@koic)
  • #1483: Fix autocorrection error when Rails/IndexWith has nested offenses. (@lovro-bikic)

Changes

  • #1500: Exclude controllers and mailers from Lint/UselessMethodDefinition. (@r7kamura)
  • #1474: Make Rails/EnumSyntax include the lib directory by default. (@koic)
  • #1463: Mark Rails/IndexWith as unsafe autocorrect. (@tejasbubane)

RuboCop Rails v2.32.0

17 May 13:42

Choose a tag to compare

Bug fixes

  • #1475: Fix Rails/TimeZone cop error on invalid string literal encoding. (@viralpraxis)
  • #1477: Fix an error for Rails/SchemaComment when the comment is passed as a local variable. (@earlopain)

Changes

  • #234: Use globs that are compatible with Engine or Packwerk. (@tdeo)

RuboCop Rails v2.31.0

01 Apr 02:48

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

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

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)