Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
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)
RuboCop Rails 2.17.4
Bug fixes
- #870: Fix an error for
Rails/RootPathnameMethodswhen usingRails.envargument withinDir.glob. (@koic) - #881: Fix a false positive for
Rails/ActionControllerFlashBeforeRenderwhen usingflashin multilinerescuebranch beforeredirect_to. (@gurix) - #871: Fix a false positive for
Rails/WhereMissingwhenleft_joins(:foo)andwhere(foos: {id: nil})separated byor,and. (@ydah) - #875: Make
Rails/RootPathnameMethodsaware of enforced style ofStyle/StringLiterals. (@koic) - #882: Fix false positive for
Rails/UniqueValidationWithoutIndexwith :conditions option. (@etiennebarrie) - #821: Enhance
Rails/TimeZoneto accept methods with the:intimezone option. (@fatkodima)
Changes
- #880: Add Rails/I18nLocaleTexts match for redirect_back. (@bensheldon)
RuboCop Rails 2.17.3
% cat relnotes/v2.17.3.md
Bug fixes
- #843: Fix a false positive for
Rails/ActionControllerFlashBeforeRenderwhen usingflashin multilineifbranch beforeredirect_to. (@koic) - #841: Fix an error for
Rails/ActionOrderwhen using unconventional order of multiple actions. (@koic) - #838: Fix an incorrect autocorrect for
Rails/ActionOrderwhen using unconventional order of actions in conditions. (@koic) - #867: Fix autocorrection bug when
::Hashis used onRails/IndexByandRails/IndexWith. (@r7kamura) - #848: Fix a false positive for
Rails/FreezeTimewhen usingtravel_towith an argument ofTime.new(...).in_time_zone. (@koic) - #869: Fix false-positives that non Rails formats are offended on
Rails/ToSWithArgument. (@r7kamura) - #866: Fix false-positives when constant is used with receiver on
Rails/DurationArithmetic,Rails/IndexBy,Rails/IndexWIth, andRails/RequireDependency. (@r7kamura) - #850: Fix default configuration for
Rails/I18nLazyLookup. (@vlad-pisanov) - #837: Fix incorrect autocorrection of
Rails/ActionOrderabout comments. (@r7kamura) - #855: Fix Rails/RootPathnameMethods autocorrection for Pathname calls without parens. (@gsamokovarov)
- #868: Support
::prefixed constants onRails/ActionControllerFlashBeforeRender,Rails/ActionControllerTestCase,Rails/ApplicationController,Rails/ApplicationJob,Rails/ApplicationMailer,Rails/ApplicationRecord,Rails/DotSeparatedKeys,Rails/DynamicFindBy,Rails/FindEach,Rails/FreezeTime,Rails/HasManyOrHasOneDependent,Rails/HelperInstanceVariable,Rails/MailerName,Rails/MigrationClassName,Rails/Output,Rails/ReversibleMigrationMethodDefinition,Rails/ReversibleMigration,Rails/ShortI18n,Rails/SkipsModelValidations, andRails/TimeZoneAssignment. (@r7kamura) - #865: Support
::Railsand::FileonRails/FilePathcop. (@r7kamura)
Changes
RuboCop Rails 2.17.2
Bug fixes
- #825: Fix a false positive for
Rails/ActionControllerFlashBeforeRenderwhen using condition beforeredirect_to. (@koic) - #833: Fix a false positive for
Rails/Pluckwhen receiver is not block argument for[]. (@koic) - #834: Fix an error for
Rails/WhereNotWithMultipleConditionswhen usingwhere.notwith empty hash literal. (@koic) - #833: Fix a false positive for
Rails/Pluckwhen using multiple block arguments. (@koic)