Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
RuboCop Rails 2.27.0
Bug fixes
- #1377: Fix an error for
Rails/EnumSyntax
when positional arguments are used and options are not passed as keyword arguments. (@koic) - #1367: Fix
Rails/TimeZone
should not report offense onString#to_time
with timezone specifier. (@armandmgt)
Changes
- #727: Disable
Rails/TransactionExitStatement
on Rails >= 7.2. (@earlopain) - #1374: Change
Rails/EnvLocal
to handle negated conditions. (@fatkodima) - #1195: Change
Rails/SelectMap
to handle safe navigation operators. (@fatkodima)
RuboCop Rails 2.26.2
Bug fixes
- #1362: Fix false positives for
Rails/EnumSyntax
when using Ruby 2.7. (@koic) - #1269: Fix false positives for
Rails/ActionControllerFlashBeforeRender
in combination with implicit returns. (@earlopain) - #1326: Fix wrong autocorrect for
Rails/FilePath
when passing an array toFile.join
. (@earlopain)
Changes
- #1359: Support
filter
inRails/CompactBlank
. (@masato-bkn)
RuboCop Rails 2.26.1
Bug fixes
- #1343: Fix false negatives for
Rails/EnumSyntax
for non-literal mappings. (@earlopain) - #1340: Fix a false positive for
Rails/WhereEquals
,Rails/WhereNot
, andRails/WhereRange
when qualifying the database name. (@earlopain)
Changes
- #1342: Change
Rails/ApplicationRecord
to ignore migrations. (@fatkodima) - #1350: Change
Rails/EnumSyntax
to autocorrect underscored options. (@fatkodima)
RuboCop Rails 2.26.0
New features
- #1238: Add new
Rails/EnumSyntax
cop. (@maxprokopiev, @koic) - #1309: Support Rails 7 syntax for
Rails/EnumHash
cop. (@ytjmt) - #1298: Support Rails 7 syntax for
Rails/EnumUniqueness
cop. (@ytjmt)
Bug fixes
- #1335: Fix an error for
Rails/BulkChangeTable
when the block forchange_table
is empty. (@earlopain) - #1325: Fix an error for
Rails/RenderPlainText
when the content type is passed as a constant. (@earlopain) - #1337: Fix an error for
Rails/Validation
when passing no arguments. (@earlopain) - #1330: Fix an error for
Rails/WhereNot
when using placeholder without second argument. (@earlopain) - #1311: Fix false negatives for
Rails/ActionControllerFlashBeforeRender
when using implicit render or rescue blocks. (@tldn0718) - #1313: Fix false positives for
Rails/CompactBlank
when usingcollection.reject!
. (@koic) - #1319: Fix a false positive for
Rails/RedundantPresenceValidationOnBelongsTo
when removingpresence
would leave other non-validation options likeallow_blank
without validations. (@earlopain) - #1306: Make
Rails/PluralizationGrammar
aware of byte methods. (@earlopain) - #1302: Allow
params
receiver by default forStyle/CollectionMethods
. (@koic) - #1321: Fix an error for
Rails/WhereEquals
when the second argument is not yet typed (where("foo = ?", )
). (@earlopain)
Changes
- #1308: Change
Rails/CompactBlank
to handleselect(&:present?)
. (@fatkodima) - #1303: Change
Rails/IgnoredSkipActionFilterOption
to handle multiple callbacks. (@fatkodima) - #1199: Make
Rails/WhereEquals
aware ofwhere.not(...)
. (@earlopain) - #1003: Change
Rails/RootPathnameMethods
to detect offenses onDir.[]
. (@r7kamura)
RuboCop Rails 2.25.1
Bug fixes
- #1280: Look for change_column_null for
Rails/BulkChangeTable
. (@ccutrer) - #1299: Fix an error for
Rails/NotNullColumn
when the block forchange_table
is empty. (@earlopain) - #1281: Fix
Rails/WhereRange
autocorrect for complex expressions. (@fatkodima) - #1282: Fix
Rails/WhereRange
to correctly handle template strings with extra spaces. (@fatkodima)
Changes
- #1295: Cover validates_comparison_of in
Rails/Validation
. (@ChaelCodes) - #1288: Let
Rails/LinkToBlank
look intolink_to_if
andlink_to_unless
, too. (@fwolfst) - #1286: Mark
Rails/SkipsModelValidations
as unsafe. (@koic) - #1283: Mark
Rails/WhereRange
as unsafe autocorrect. (@fatkodima)
RuboCop Rails 2.25.0
New features
- #1272: Add new
Rails/WhereRange
cop. (@fatkodima)
Bug fixes
- #1270: Fix an incorrect autocorrect for
Rails/Validation
when usingvalidates_size_of
. (@koic) - #1278: Fix a false positive for
Rails/SkipsModelValidations
when usinginsert
orinsert!
with a safe navigator. (@tldn0718) - #1260: Fix a performance regression caused by
Rails/UnknownEnv
when using Rails 7.1. (@lukasfroehlich1)
Changes
- #1249: Disable
Rails/UnusedIgnoredColumns
by default. (@earlopain) - #1266: Check
change_table
calls for offenses. (@ccutrer) - #1267: Make
Rails/HttpStatus
aware of Rails-specific response assertions. (@tldn0718) - #1137: Migrate to
TargetRailsVersion
the newrequires_gem
API. (@amomchilov)
RuboCop Rails 2.24.1
Bug fixes
- #1244: Fix a false positive for
Rails/ActionControllerFlashBeforeRender
when returningredirect_to
. (@earlopain) - #1255: Fix an error for
Rails/UniqBeforePluck
withEnforcedStyle: aggressive
when no receiver. (@earlopain) - #1247: Fix an error for
Rails/UnusedIgnoredColumns
when without tables in db/schema.rb. (@koic) - #1253: Fix an error for
Rails/WhereMissing
with leadingwhere
without receiver. (@earlopain) - #1254: Fix an error for
Rails/ExpandedDateRange
when passing an argument only to the first method call for weeks. (@earlopain) - #1256: Fix an error for
Rails/ActiveSupportOnLoad
when calling without arguments. (@earlopain) - #1230: Fix a false positive for
Rails/SaveBang
ifpersisted?
is checked on parenthesised expression. (@earlopain) - #1200: Make
Rails/TimeZone
aware of safe navigation. (@earlopain)
Changes
- #1257: Add Rails 7.1 load hooks and
active_record_sqlite3adapter
toRails/ActiveSupportOnLoad
. (@earlopain)
RuboCop Rails 2.24.0
New features
Bug fixes
- #1234: Fix an incorrect autocorrect for
Rails/FindBy
when using multi-line leading dot method calls. (@ymap) - #1241: Fix an error for
Rails/WhereExists
withEnforcedStyle: where
and implicit receivers. (@earlopain)
Changes
- #1229: Make
Rails/EnvironmentVariableAccess
aware of initializers. (@markokajzer) - #1231: Remove
object_id
fromRails/DangerousColumnNames
targets. (@r7kamura)
RuboCop Rails 2.23.1
Bug fixes
- #1221: Fix an exception in
Rails/WhereNot
when calling.where
on an implicit receiver (e.g. inside model code). (@bquorning)
RuboCop Rails 2.23.0 (The RubyConf Taiwan 2023 Edition)
New features
- #1183: Support PostGIS adapter for PostgreSQL. (@Dania02525)
Bug fixes
- #1206: Fix an error for
Rails/WhereMissing
where join method is called without arguments. (@fatkodima) - #1189: Fix false negatives for
Rails/Pluck
when using safe navigation method calls. (@koic) - #1204: Make
Rails/ActiveSupportAliases
,Rails/FindBy
,Rails/FindById
,Rails/Inquiry
,Rails/Pick
Rails/PluckId
,Rails/PluckInWhere
,Rails/WhereEquals
,Rails/WhereExists
, andRails/WhereNot
cops aware of safe navigation operator. (@koic)
Changes
- #1213: Update
Rails/PluckInWhere
to check for.ids
call. (@fatkodima) - #1181: Support
Nokogiri::HTML.parse
andNokogiri::HTML5.parse
onRails/ResponseParsedBody
. (@r7kamura) - #1198: Support
where.not
forRails/PluckInWhere
. (@fatkodima)