Releases: rubocop/rubocop-rails
Releases · rubocop/rubocop-rails
RuboCop Rails 2.10.0
New features
- #457: Add new
Rails/ReversibleMigrationMethodDefinition
cop. (@leonp1991) - #446: Add new
Rails/RequireDependency
cop. (@tubaxenor) - #458: Add new
Rails/TimeZoneAssignment
cop. (@olivierbuffon) - #442: Add new
Rails/EnvironmentVariableAccess
cop. (@drenmi)
Bug fixes
- #421: Fix incorrect auto-correct for
Rails/LinkToBlank
when usingtarget: '_blank'
with hash brackets for the option. (@koic) - #436: Fix a false positive for
Rails/ContentTag
when the first argument is a splat argument. (@koic) - #435: Fix a false negative for
Rails/BelongsTo
when usingbelongs_to
lambda block withrequired
option. (@koic) - #451: Fix a false negative for
Rails/RelativeDateConstant
when a method is chained after a relative date method. (@koic) - #450: Fix a crash for
Rails/ContentTag
with nested content tags. (@tejasbubane) - #103: Fix a false positive for
Rails/FindEach
when not inheritingActiveRecord::Base
and usingall.each
. (@koic) - #466: Fix a false positive for
Rails/DynamicFindBy
when not inheritingApplicationRecord
and without no receiver. (@koic) - #147: Fix a false positive for
Rails/HasManyOrHasOneDependent
when specifying defaultdependent: nil
strategy. (@koic) - #137: Make
Rails/HasManyOrHasOneDependent
aware ofreadonly?
istrue
. (@koic) - #474: Fix a false negative for
Rails/SafeNavigation
when usingtry!
without receiver. (@koic) - #126: Fix an incorrect auto-correct for
Rails/SafeNavigation
withStyle/RedndantSelf
. (@koic) - #476: Fix a false positive for
Rails/ReversibleMigration
when usingdrop_table
with symbol proc. (@koic)
Changes
- #409: Deconstruct "table.column" in
Rails/WhereNot
. (@mobilutz) - #416: Make
Rails/HasManyOrHasOneDependent
accept combination of association extension andwith_options
. (@ohbarye) - #432: Exclude gemspec file by default for
Rails/TimeZone
cop. (@koic) - #440: This PR makes
Rails/TimeZone
aware of timezone specifier. (@koic) - #381: Update
IgnoredMethods
list forLint/NumberConversion
to allow Rails' duration methods. (@dvandersluis) - #444: Mark
Rails/Blank
as unsafe auto-correction. (@koic) - #451: Make
Rails/RelativeDateConstant
aware ofyesterday
andtomorrow
methods. (@koic) - #454: Mark
Rails/WhereExists
as unsafe auto-correction. (@koic) - #403: Mark
Rails/WhereEquals
as unsafe auto-correction. (@koic) - #379: Mark
Rails/DynamicFindBy
as unsafe. (@koic) - #106: Mark
Rails/ReflectionClassName
as unsafe. (@koic) - #106: Make
Rails/ReflectionClassName
aware of the use of string withto_s
. (@koic) - #456: Drop Ruby 2.4 support. (@koic)
- #462: Require RuboCop 1.7 or higher. (@koic)
RuboCop Rails 2.9.1
Bug fixes
- #408: Fix bug in
Rails/FindEach
where config was ignored. (@ghiculescu) - #401: Fix an error for
Rails/WhereEquals
using only named placeholder template without replacement argument. (@koic)
Changes
RuboCop Rails 2.9.0
New features
- #362: Add new
Rails/WhereEquals
cop. (@eugeneius) - #339: Add new
Rails/AttributeDefaultBlockValue
cop. (@cilim) - #344: Add new
Rails/ArelStar
cop which checks for quoted literal asterisks inarel_table
calls. (@flanger001) - #389: Add
IgnoredMethods
config option forRails/FindEach
cop. (@tejasbubane)
Bug fixes
- #371: Fix an infinite loop error for
Rails/ActiveRecordCallbacksOrder
when callbacks have inline comments. (@fatkodima) - #364: Fix a problem that
Rails/UniqueValidationWithoutIndex
doesn't work in classes defined with compact style. (@sinsoku) - #384: Mark unsafe for
Rails/NegateInclude
. (@koic) - #394: Fix false offense detection of
Rails/RedundantAllowNil
when using both allow_nil and allow_blank on different helpers of the same validator`. (@ngouy)
Changes
- #383: Require RuboCop 0.90 or higher. (@koic)
- #365: Mark
Rails/SquishedSQLHeredocs
unsafe for autocorrection. (@tejasbubane)
RuboCop Rails 2.8.1
Bug fixes
- #345: Fix error of
Rails/AfterCommitOverride
onafter_commit
with a lambda. (@pocke) - #349: Fix errors of
Rails/UniqueValidationWithoutIndex
. (@Tietew) - #338: Fix a false positive for
Rails/IndexBy
andRails/IndexWith
when theeach_with_object
hash is used in the transformed key or value. (@eugeneius) - #351: Add
<>
operator toRails/WhereNot
cop. (@Tietew) - #352: Do not register offense if given a splatted hash. (@dvandersluis)
- #346: Fix a false positive for
Rails/DynamicFindBy
when any of the arguments are splat argument. (@koic) - #357: Fix a false positive for
Rails/ReversibleMigration
when keyword arguments ofchange_column_default
are in the order ofto
,from
. (@koic)
RuboCop Rails 2.8.0
New features
- #291: Add new
Rails/SquishedSQLHeredocs
cop. (@mobilutz) - #52: Add new
Rails/AfterCommitOverride
cop. (@fatkodima) - #323: Add new
Rails/OrderById
cop. (@fatkodima) - #274: Add new
Rails/WhereNot
cop. (@fatkodima) - #311: Make
Rails/HelperInstanceVariable
aware of memoization. (@koic) - #332: Fix
Rails/ReflectionClassName
cop false negative when relation had a scope parameter. (@bubaflub)
Bug fixes
- #315: Allow to use frozen scope for
Rails/UniqueValidationWithoutIndex
. (@krim) - #313: Fix
Rails/ActiveRecordCallbacksOrder
to preserve the original callback execution order. (@eugeneius) - #319: Fix a false positive for
Rails/Inquiry
when#inquiry
's receiver is a variable. (@koic) - #327: Fix
Rails/ContentTag
autocorrect to handle html5 tag names with hyphens. (@jaredmoody)
Changes
- #312: Mark
Rails/MailerName
as unsafe for auto-correct. (@eugeneius) - #294: Update
Rails/ReversibleMigration
to register offenses forremove_columns
andremove_index
. (@philcoggins) - #310: Add
EnforcedStyle
toRails/PluckInWhere
. By default, it does not register an offense ifpluck
method's receiver is a variable. (@koic) - #320: Mark
Rails/UniqBeforePluck
as unsafe auto-correction. (@kunitoo) - #324: Make
Rails/IndexBy
andRails/IndexWith
aware ofto_h
with block. (@eugeneius) - #341: Make
Rails/WhereExists
configurable to allowwhere(...).exists?
to be the preferred style. (@dvandersluis)
RuboCop Rails 2.7.1
Bug fixes
- #297: Handle an upstream Ruby issue where the DidYouMean module is not available, which would break the
Rails/UnknownEnv
cop. (@taylorthurlow) - #300: Fix
Rails/RenderInline
error on variable key in render options. (@tejasbubane) - #305: Fix crash in
Rails/MatchRoute
cop whenvia
option is a variable. (@tejasbubane)
Changes
RuboCop Rails 2.7.0
New features
- #283: Add new
Rails/FindById
cop. (@fatkodima) - #285: Add new
Rails/ActiveRecordCallbacksOrder
cop. (@fatkodima) - #276: Add new
Rails/RenderPlainText
cop. (@fatkodima) - #76: Add new
Rails/DefaultScope
cop. (@fatkodima) - #275: Add new
Rails/MatchRoute
cop. (@fatkodima) - #286: Add new
Rails/WhereExists
cop. (@fatkodima) - #271: Add new
Rails/RenderInline
cop. (@fatkodima) - #281: Add new
Rails/MailerName
cop. (@fatkodima) - #280: Add new
Rails/ShortI18n
cop. (@fatkodima) - #282: Add new
Rails/Inquiry
cop. (@fatkodima) - #246: Add new
Rails/PluckInWhere
cop. (@fatkodima) - #17: Add new
Rails/NegateInclude
cop. (@fatkodima) - #278: Add new
Rails/Pluck
cop. (@eugeneius) - #272: Add new
Rails/PluckId
cop. (@fatkodima)
Bug fixes
- #261: Fix auto correction for
Rails/ContentTag
whencontent_tag
is called with options hash and block. (@fatkodima)
Changes
RuboCop Rails 2.6.0
New features
- #51: Add allowed receiver class names option for
Rails/DynamicFindBy
. (@tejasbubane) - #211: Add autocorrect to
Rails/RakeEnvironment
cop. (@tejasbubane) - #242: Add
Rails/ContentTag
cop. (@tabuchi0919) - #249: Add new
Rails/Pick
cop. (@eugeneius) - #257: Add new
Rails/RedundantForeignKey
cop. (@eugeneius)
Bug fixes
- #12: Fix a false positive for
Rails/SkipsModelValidations
when passing a boolean literal totouch
. (@eugeneius) - #238: Fix auto correction for
Rails/IndexBy
when the.to_h
invocation is separated in multiple lines. (@diogoosorio) - #248: Fix a false positive for
Rails/SaveBang
whenupdate
is called onENV
. (@eugeneius) - #251: Fix a false positive for
Rails/FilePath
when the result ofRails.root.join
is interpolated at the end of a string. (@eugeneius) - #91: Fix
Rails/UniqBeforePluck
to not recommend usinguniq
inActiveRecord::Relation
s anymore since it was deprecated in Rails 5.0. (@santib, @ghiculescu)
Changes
RuboCop Rails 2.5.2
RuboCop Rails 2.5.1
Bug fixes
- #213: Fix a false positive for
Rails/UniqueValidationWithoutIndex
when using conditions. (@sunny) - #215: Fix a false positive for
Rails/UniqueValidationWithoutIndex
when using Expression Indexes. (@koic) - #214: Fix an error for
Rails/UniqueValidationWithoutIndex
when a table has no column definition. (@koic) - #221: Make
Rails/UniqueValidationWithoutIndex
aware ofadd_index
in db/schema.rb. (@koic)
Changes
- #223: Mark
Rails/ApplicationController
,Rails/ApplicationJob
,Rails/ApplicationMailer
, andRails/ApplicationRecord
as unsafe autocorrect. (@hoshinotsuyoshi)