Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
RuboCop Rails 2.22.2
Bug fixes
- #1172: Fix an error for
Rails/UnknownEnv
when using Rails 7.1. (@koic) - #1173: Fix an error for
Rails/RedundantActiveRecordAllMethod
cop when used with RuboCop 1.51 or lower. (@koic)
Changes
- #1171: Change
Rails/RedundantActiveRecordAllMethod
to ignoredelete_all
anddestroy_all
when receiver is an association. (@masato-bkn) - #1178: Require RuboCop AST 1.30.0+. (@koic)
RuboCop Rails 2.22.1
RuboCop Rails 2.22.0
New features
- #906: Add
Rails/EnvLocal
cop. (@sambostock) - #1128: Make
Rails/DuplicateAssociation
aware of duplicateclass_name
. (@koic) - #1157: Support some Rails 7.1's new querying methods for
Rails/RedundantActiveRecordAllMethod
. (@koic) - #1147: Support the Trilogy adapter for MySQL. (@koic)
Bug fixes
- #952: Fix a false positive for
Rails/NotNullColumn
when usingnull: false
for MySQL's TEXT type. (@koic) - #1041: Fix a false positive for
Rails/Output
when output method is called with block argument. (@koic) - #1143: Fix an error for
Rails/RedundantActiveRecordAllMethod
when using RuboCop 1.51 or lower. (@koic) - #1105: Fix false positives for
Rails/RedundantPresenceValidationOnBelongsTo
when usingvalidates
with:if
or:unless
options. (@koic) - #1158:
Rails/HasManyOrHasOneDependent
does not add offence when has_many or has_one is called on an explicit receiver. (@samrjenkins) - #1160: Fix
Rails/SaveBang
to ignore parenthesis. (@fatkodima)
Changes
RuboCop Rails 2.21.2
Bug fixes
- #1126: Fix a false positive for
Rails/RedundantActiveRecordAllMethod
when using someEnumerable
's methods with block argument. (@koic) - #1121: Fix an error for
Rails/SelectMap
when usingselect(:column_name).map(&:column_name)
without receiver model. (@koic) - #1119: Fix an incorrect autocorrect for
Rails/RedundantActiveRecordAllMethod
whenall
has parentheses. (@masato-bkn) - #1130: Fix crash for
Rails/UniqueValidationWithoutIndex
with bare validate. (@jamiemccarthy) - #1124: Fix false positives for
Rails/RedundantActiveRecordAllMethod
when receiver is not an Active Record model. (@koic)
RuboCop Rails 2.21.1
Bug fixes
- #1108: Fix an incorrect autocorrect for
Rails/TimeZone
when usingString#to_time
. (@koic) - #1109: Fix error for
Rails/RedundantActiveRecordAllMethod
whenall
is an argument for AR methods. (@masato-bkn) - #1110: Fix false positive for
Rails/RedundantActiveRecordAllMethod
whenall
has any parameters. (@masato-bkn)
RuboCop Rails 2.21.0
New features
- #1075: Add new
Rails/SelectMap
cop that checks for uses ofselect(:column_name)
withmap(&:column_name)
. (@koic) - #158: Add
Rails/DangerousColumnNames
cop. (@r7kamura) - #1072: Add
TransactionMethods
config forRails/TransactionExitStatement
to detect custom transaction methods. (@marocchino) - #967: Add new
Rails/UnusedRenderContent
cop. (@samrjenkins) - #1052: Add explicit style to
Rails/I18nLazyLookup
. (@sunny) - #1016: Add new
Rails/RedundantActiveRecordAllMethod
cop. (@masato-bkn)
Bug fixes
- #1078: Fix a false negative for
Rails/LexicallyScopedActionFilter
when no methods are defined. (@vlad-pisanov) - #1060: Fix a false positive for
Rails/HttpStatus
when using symbolic value that have no numeric value mapping. (@koic) - #1004: Fix a false-positive for
Rails/RootPathnameMethods
on Ruby 2.4 or lower. (@r7kamura) - #1066: Fix an error for
Rails/FilePath
when string interpolatedRails.root
is followed by a message starting with.
. (@koic) - #1049: Fix an incorrect autocorrect for
Rails/FilePath
when File.join with Rails.root and path starting with/
. (@ydah) - #1045: Fix an incorrect autocorrect for
Rails/NegateInclude
when usingStyle/InverseMethods
's autocorrection together. (@koic) - #1062: Fix autocorrection for
Rails/RakeEnvironment
when rake task accepts arguments. (@fastjames) - #1036: Fix an error for
UniqueValidationWithoutIndex
whendb/schema.rb
is empty. (@fatkodima) - #1042: Fix no offences for
Rails/SchemaComment
when create_table with multi t columns. (@nipe0324)
Changes
- #1056: Fix database adapter detection for nested config. (@mjankowski)
- #1031: Make
Lint/SafeNavigationChain
allowpresence_in
. (@koic) - #1080: Make
Rails/HttpStatus
aware of string number status. (@r7kamura) - #1094: Make
Rails/TimeZone
aware ofString#to_time
. (@koic) - #1015: Make
Style/InvertibleUnlessCondition
aware of Active Support methods. (@koic) - #903: Read database config for
Rails/BulkChangeTable
from environment variable. (@joergschiller) - #1058: Relax
Include
path forRails/FindBy
andRails/FindEach
. (@koic) - #994: Restrict DuplicateAssociation cop to ActiveRecord. (@mjankowski)
RuboCop Rails 2.20.2
RuboCop Rails 2.20.1
RuboCop Rails 2.20.0
New features
- #999: Add autocorrection for
Rails/Date
. (@r7kamura) - #991: Add autocorrection for
Rails/FilePath
. (@r7kamura) - #988: Add autocorrection for
Rails/IgnoredSkipActionFilterOption
. (@r7kamura)
Bug fixes
- #1005: Flag
break
inwith_lock
forRails/TransactionExitStatement
. (@splattael) - #997: Fix to Allow
NotNullColumn
to work with method calls and variables. (@fidalgo) - #989: Fix
Rails/FilePath
to detect offenses from complex string interpolation. (@r7kamura) - #1010: Fix
Rails/ThreeStateBooleanColumn
for dynamic tables/columns. (@fatkodima) - #1008: Fix
UniqueValidationWithoutIndex
to not detect offenses when a validation specifiesuniqueness: false
. (@samrjenkins)
Changes
- #1011: Add
*_create_active_storage_variant_records.active_storage.rb
toRails/CreateTableWithTimestamps
exclude file list. (@tka5) - #995: Check for
or
method inRails/FindEach
cop. (@masato-bkn) - #1019: Change db migration file pattern so that it supports multiple db. (@r7kamura)
- #986: (Breaking) Drop Ruby 2.6 support. (@koic)
- #992: Exclude
app/assets/**/*
by default. (@r7kamura) - #1014: Make
Lint/RedundantSafeNavigation
aware ofpresence
andpresent?
methods. (@koic) - #1007: Support
flash.now
forRails/I18nLocaleTexts
. (@fatkodima)