Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
RuboCop Rails 2.22.0
New features
- #906: Add
Rails/EnvLocalcop. (@sambostock) - #1128: Make
Rails/DuplicateAssociationaware 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/NotNullColumnwhen usingnull: falsefor MySQL's TEXT type. (@koic) - #1041: Fix a false positive for
Rails/Outputwhen output method is called with block argument. (@koic) - #1143: Fix an error for
Rails/RedundantActiveRecordAllMethodwhen using RuboCop 1.51 or lower. (@koic) - #1105: Fix false positives for
Rails/RedundantPresenceValidationOnBelongsTowhen usingvalidateswith:ifor:unlessoptions. (@koic) - #1158:
Rails/HasManyOrHasOneDependentdoes not add offence when has_many or has_one is called on an explicit receiver. (@samrjenkins) - #1160: Fix
Rails/SaveBangto ignore parenthesis. (@fatkodima)
Changes
RuboCop Rails 2.21.2
Bug fixes
- #1126: Fix a false positive for
Rails/RedundantActiveRecordAllMethodwhen using someEnumerable's methods with block argument. (@koic) - #1121: Fix an error for
Rails/SelectMapwhen usingselect(:column_name).map(&:column_name)without receiver model. (@koic) - #1119: Fix an incorrect autocorrect for
Rails/RedundantActiveRecordAllMethodwhenallhas parentheses. (@masato-bkn) - #1130: Fix crash for
Rails/UniqueValidationWithoutIndexwith bare validate. (@jamiemccarthy) - #1124: Fix false positives for
Rails/RedundantActiveRecordAllMethodwhen receiver is not an Active Record model. (@koic)
RuboCop Rails 2.21.1
Bug fixes
- #1108: Fix an incorrect autocorrect for
Rails/TimeZonewhen usingString#to_time. (@koic) - #1109: Fix error for
Rails/RedundantActiveRecordAllMethodwhenallis an argument for AR methods. (@masato-bkn) - #1110: Fix false positive for
Rails/RedundantActiveRecordAllMethodwhenallhas any parameters. (@masato-bkn)
RuboCop Rails 2.21.0
New features
- #1075: Add new
Rails/SelectMapcop that checks for uses ofselect(:column_name)withmap(&:column_name). (@koic) - #158: Add
Rails/DangerousColumnNamescop. (@r7kamura) - #1072: Add
TransactionMethodsconfig forRails/TransactionExitStatementto detect custom transaction methods. (@marocchino) - #967: Add new
Rails/UnusedRenderContentcop. (@samrjenkins) - #1052: Add explicit style to
Rails/I18nLazyLookup. (@sunny) - #1016: Add new
Rails/RedundantActiveRecordAllMethodcop. (@masato-bkn)
Bug fixes
- #1078: Fix a false negative for
Rails/LexicallyScopedActionFilterwhen no methods are defined. (@vlad-pisanov) - #1060: Fix a false positive for
Rails/HttpStatuswhen using symbolic value that have no numeric value mapping. (@koic) - #1004: Fix a false-positive for
Rails/RootPathnameMethodson Ruby 2.4 or lower. (@r7kamura) - #1066: Fix an error for
Rails/FilePathwhen string interpolatedRails.rootis followed by a message starting with.. (@koic) - #1049: Fix an incorrect autocorrect for
Rails/FilePathwhen File.join with Rails.root and path starting with/. (@ydah) - #1045: Fix an incorrect autocorrect for
Rails/NegateIncludewhen usingStyle/InverseMethods's autocorrection together. (@koic) - #1062: Fix autocorrection for
Rails/RakeEnvironmentwhen rake task accepts arguments. (@fastjames) - #1036: Fix an error for
UniqueValidationWithoutIndexwhendb/schema.rbis empty. (@fatkodima) - #1042: Fix no offences for
Rails/SchemaCommentwhen create_table with multi t columns. (@nipe0324)
Changes
- #1056: Fix database adapter detection for nested config. (@mjankowski)
- #1031: Make
Lint/SafeNavigationChainallowpresence_in. (@koic) - #1080: Make
Rails/HttpStatusaware of string number status. (@r7kamura) - #1094: Make
Rails/TimeZoneaware ofString#to_time. (@koic) - #1015: Make
Style/InvertibleUnlessConditionaware of Active Support methods. (@koic) - #903: Read database config for
Rails/BulkChangeTablefrom environment variable. (@joergschiller) - #1058: Relax
Includepath forRails/FindByandRails/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
breakinwith_lockforRails/TransactionExitStatement. (@splattael) - #997: Fix to Allow
NotNullColumnto work with method calls and variables. (@fidalgo) - #989: Fix
Rails/FilePathto detect offenses from complex string interpolation. (@r7kamura) - #1010: Fix
Rails/ThreeStateBooleanColumnfor dynamic tables/columns. (@fatkodima) - #1008: Fix
UniqueValidationWithoutIndexto not detect offenses when a validation specifiesuniqueness: false. (@samrjenkins)
Changes
- #1011: Add
*_create_active_storage_variant_records.active_storage.rbtoRails/CreateTableWithTimestampsexclude file list. (@tka5) - #995: Check for
ormethod inRails/FindEachcop. (@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/RedundantSafeNavigationaware ofpresenceandpresent?methods. (@koic) - #1007: Support
flash.nowforRails/I18nLocaleTexts. (@fatkodima)
RuboCop Rails 2.19.1
RuboCop Rails 2.19.0
New features
- #337: Add new
Rails/ThreeStateBooleanColumncop. (@fatkodima) - #45: Make
Rails/Delegateaware ofself. (@koic)
Bug fixes
- #934: Fix a false negative for
Rails/Outputwhen print methods without arguments. (@koic) - #99: Fix a false positive for
Rails/HttpPositionalArgumentswhen usinginclude Rack::Test::Methods. (@koic) - #501: Fix a false positive for
Rails/OutputSafetywhen usinghtml_safeforI18nmethods. (@koic) - #860: Fix a false positive for
Rails/Pluckwhen using regexp literal key forString#[]. (@koic) - #938: Fix an error for
Rails/WhereNotWithMultipleConditionswhen usingwhere.not.lt(condition)as a Mongoid API'. (@koic) - #941: Remove redundant config for
Style/InverseMethods. (@koic)
Changes
RuboCop Rails 2.18 (a.k.a. Ruby 30th Anniversary Edition)
New features
Bug fixes
- #824: Fix a false negative for
Rails/ActionControllerTestCasewhen the class is namespaced. (@vlad-pisanov) - #909: Fix a false positive for
Rails/ActionControllerFlashBeforeRenderwhen usingflashbeforeredirect_toinifbranch. (@koic) - #898: Fix a false positive for
Rails/ActiveRecordAliaseswhen arguments ofupdate_attributesis empty. (@koic) - #920: Fix an error for
Rails/NegateIncludewhen there is no receiver. (@fatkodima) - #931: Fix error in
Rails/Presencewhen ternary operators are used in multiple lines. (@r7kamura) - #687: Fix
Rails/HasManyOrHasOneDependentto correctly handle association methods with receiver. (@fatkodima) - #929: Prevent
Rails/SquishedSQLHeredocsapplying when single-line comments are present. (@john-h-k) - #887: Fix a false positive for
Rails/NotNullColumnwhen adding a:virtualcolumn. (@fatkodima) - #918: Fix
Rails/FreezeTimerunning against Rails < 5.2 apps. (@DRBragg) - #895: Fix
Rails/UnusedIgnoredColumnsnot recognizing columns added via+=. (@lucthev)
Changes
- #263: Accept actions defined via
aliasinRails/LexicallyScopedActionFilter. (@fatkodima) - #902: Ignore
redirectmethod forStyle/FormatStringTokenby default. (@javierjulio) - #935: Make
Style/InverseMethodsaware of Active Support'spresent?,blank?,include?, andexclude?methods. (@koic) - #914: Make
Style/InverseMethodsaware ofvalid?andinvalid?methods. (@koic) - #826: Mark
Rails/Pluckas unsafe. (@fatkodima) - #896: Raise severity of
Rails/ActiveRecordOverride,Rails/DeprecatedActiveModelErrorsMethods,Rails/DuplicateAssociation,Rails/DuplicateScope,Rails/TopLevelHashWithIndifferentAccess, andRails/WhereNotWithMultipleConditionscops to warning. (@koic)