Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
RuboCop Rails 2.16.0
New features
- #714: Add new
Rails/FreezeTime
cop. (@ydah) - #744: Add new
Rails/WhereMissing
cop. (@ydah) - #587: Add new
Rails/RootPathnameMethods
cop. (@leoarnold) - #752: Add
Rails/TopLevelHashWithIndifferentAccess
cop. (@r7kamura) - #759: Add new
Rails/ActionControllerFlashBeforeRender
cop. (@americodls) - #749: Add new
Rails/ActiveSupportOnLoad
cop. (@bdewater) - #747: Add
Rails/ToSWithArgument
cop. (@r7kamura) - #746: Enable
ActiveSupportExtensionsEnabled
option by default. (@koic)
Bug fixes
- #757: Fix a false positive for
Rails/ReflectionClassName
when using Ruby 3.1's hash shorthand syntax. (@koic) - #741: Fix a bad autocorrection for
errors.details[:name] << value
in Rails/DeprecatedActiveModelErrorsMethods. (@BrianHawley) - #742: Rails/DeprecatedActiveModelErrorsMethods was missing the deprecated
values
,to_h
, andto_xml
methods. (@BrianHawley) - #740: Fix a NoMethodError on nil for
errors.keys
in a model in Rails/DeprecatedActiveModelErrorsMethods. (@BrianHawley) - #753: Fix
Rails/CompactBlank
bug when offense is found in block. (@r7kamura) - #756: Fix incorrect documentation URLs when using
rubocop --show-docs-url
. (@r7kamura) - #754: Make
Rails/RedundantReceiverInWithOptions
andRails/ReversibleMigration
cops aware of numbered block parameter. (@koic)
Changes
RuboCop Rails 2.15.2
Bug fixes
- #712: Fix false negative in
Rails/Delegate
when preceding nested class declares private or protected methods. (@Darhazer) - #737: Fix a false positive for
Rails/DeprecatedActiveModelErrorsMethods
when usingkeys
method with Rails 6.0. (@koic) - #737: Make
Rails/ExpandedDateRange
awarebeginning_of_week
with an argument. (@koic) - #731: Fix an incorrect autocorrect for
Rails/StripHeredoc
. (@kazarin)
RuboCop Rails 2.15.1
Bug fixes
- #723: Fix include value in
Rails/AttributeDefaultBlockValue
. (@kkitadate) - #717: Fix an error for
Rails/DeprecatedActiveModelErrorsMethods
when root receiver is a variable. (@koic) - #719: Fix a false negative for
Rails/FormattedS
when using safe navigation operator. (@koic) - #725: Fix an incorrect autocorrect for
Rails/DotSeparatedKeys
when a key starts with dot. (@koic)
RuboCop Rails 2.15.0
New features
- #325: Add new
Rails/DotSeparatedKeys
cop. (@fatkodima) - #704: Add new
Rails/StripHeredoc
cop. (@koic) - #691: Add new
Rails/ToFormattedS
cop. (@koic) - #588: Add new
Rails/RootPublicPath
cop. (@leoarnold) - #702: Make
keys
method aware ofRails/DeprecatedActiveModelErrorsMethods
cop. (@koic) - #688: Support autocorrection for
Rails/DeprecatedActiveModelErrorsMethods
. (@koic)
Bug fixes
- #696: Fix a false negative for
Rails/TransactionExitStatement
whenreturn
is used inrescue
. (@koic) - #700: Fix a false positive for
Rails/FilePath
when a list of paths separated by colon including Rails.root. (@tk0miya) - #680: Fix a false positive for
Rails/ReversibleMigrationMethodDefinition
when using an inner class. (@koic) - #692: Fix an error for
Rails/UnusedIgnoredColumns
when using no tables db/schema.rb. (@koic) - #707: Fix an error when a variable is passed to has_many or has_one with double splat. (@nobuyo)
- #695: Fixes a false negative where the
in_rescue?
check would bypass situations where the return was inside a transaction but outside of a rescue. (@dorkrawk) - #703: Fix not autocorrected for
Rails/DuplicateAssociation
. (@ydah) - #708: Recover Ruby 2.2 code analysis using
TargetRubyVersion: 2.2
. (@koic)
Changes
RuboCop Rails 2.14.2
Bug fixes
- #660: Fix a false positive for
Rails/MigrationClassName
when defining another class. (@koic) - #664: Fix a false positive for
Rails/MigrationClassName
whenActiveSupport::Inflector
is applied to the class name and the case is different. (@koic) - #658: Fix a false positive for
Rails/TransactionExitStatement
whenbreak
is used inloop
in transactions. (@koic) - #666: Fix an error for
Rails/TransactionExitStatement
when transaction block is empty. (@koic) - #673: Fix a false negative for
Rails/TransactionExitStatement
whenreturn
orthrow
is used in a block in transactions. (@Tietew) - #669: Fix a false positive for
Rails/TransactionExitStatement
whenreturn
is used inrescue
. (@koic)
RuboCop Rails 2.14.1
RuboCop Rails 2.14.0
New features
- #624: Add new
Rails/I18nLocaleTexts
cop. (@fatkodima) - #326: Add new
Rails/I18nLazyLookup
cop. (@fatkodima) - #644: Add new
Rails/MigrationClassName
cop. (@johnny-miyake) - #599: Add new
Rails/DuplicateAssociation
cop. (@natematykiewicz) - #427: Add
Rails/DuplicateScope
cop. (@natematykiewicz) - #642: New cop
Rails/TransactionExitStatement
to disallowreturn
,break
andthrow
in transactions. (@teckwan) - #491: New
Rails/DeprecatedActiveModelErrorsMethods
cop. (@lulalala) - #638: Add new
Rails/ActionControllerTestCase
cop. (@gmcgibbon) - #574: Add new
Rails/TableNameAssignment
cop. (@MaximeDucheneS)
Bug fixes
- #636: Fix a false positive for
Rails/ContentTag
when usingtag
method in config/puma.rb. (@koic) - #635: Handle
t.remove
with multiple columns inRails/BulkChangeTable
. (@eugeneius)
Changes
RuboCop Rails 2.13.2
New features
- #614: Add
IgnoreScopes
config option forRails/InverseOf
cop. (@composerinteralia)
Bug fixes
- #620: Fix a false positive for
Rails/RedundantPresenceValidationOnBelongsTo
using presence with a message. (@koic) - #626: Fix a false positive for
Rails/CompactBlank
when using the receiver ofblank?
is not a block variable. (@koic) - #622: Add
month(s)
andyear(s)
toRails/DurationArithmetic
cop. (@agrobbin) - #623: Fix method shadowing check for
Rails/ReadWriteAttribute
cop. (@nvasilevski)
Changes
- #615: Change
Rails/RedundantPresenceValidationOnBelongsTo
toSafeAutoCorrect: false
. (@TonyArra) - #463: Support multiple databases for
ReversibleMigration
andReversibleMigrationMethodDefinition
cops. (@fatkodima)
RuboCop Rails 2.13.1
Bug fixes
- #601: Handle ignored_columns from mixins for
Rails/UnusedIgnoredColumns
cop. (@tachyons) - #603: Fix autocorrection of multiple attributes for
Rails/RedundantPresenceValidationOnBelongsTo
cop. (@pirj) - #608: Fix autocorrection of strict validation for
Rails/RedundantPresenceValidationOnBelongsTo
cop. (@pirj)
Changes
RuboCop Rails 2.13.0
New features
- #586: Add new
Rails/RootJoinChain
cop. (@leoarnold) - #571: Add
Rails/DurationArithmetic
cop. (@pirj) - #594: Add
Rails/RedundantPresenceValidationOnBelongsTo
cop. (@pirj) - #568: Add
Rails/SchemaComment
cop. (@vitormd)
Changes
- #591: Add
change_column
check toRails/ReversibleMigration
. (@mattmccormick) - Add
remove_reference
check toRails/ReversibleMigration
. (@mattmccormick) - #576: Mark
Rails/TimeZone
as unsafe auto-correction from unsafe. (@koic) - #582: Unmark
AutoCorrect: false
fromRails/RelativeDateConstant
. (@koic) - #580: Unmark
AutoCorrect: false
fromRails/UniqBeforePluck
. (@koic)