Skip to content

Releases: rubocop/rubocop-rails

RuboCop Rails 2.11.2

01 Jul 16:13
Compare
Choose a tag to compare

Bug fixes

  • #515: Fix an error for Rails/BulkChangeTable when using Psych 4.0. (@koic)
  • #512: Fix a false positive for Rails/FindBy when using take with arguments. (@koic)

RuboCop Rails 2.11.1

25 Jun 02:48
Compare
Choose a tag to compare

Bug fixes

  • #509: Fix an error for Rails/ReflectionClassName when using class_name: to_s. (@skryukov)
  • #510: Fix an error for Rails/FindBy when calling #first or #take on a Range object. (@johnsyweb)
  • #507: Fix an error for Rails/FindBy when calling take after block. (@koic)
  • #504: Fix a false positive for Rails/FindBy when receiver is not an Active Record. (@nvasilevski)

RuboCop Rails 2.11.0

21 Jun 10:30
Compare
Choose a tag to compare

New features

Bug fixes

  • #482: Fix a false positive for Rails/RelativeDateConstant when assigning (hashes/arrays/etc)-containing procs to a constant. (@jdelStrother)
  • #419: Fix an error for Rails/UniqueValidationWithoutIndex when using a unique index and check_constraint that has nil first argument. (@koic)
  • #70: Fix a false positive for Rails/TimeZone when setting EnforcedStyle: strict and using Time.current. (@koic)
  • #488: Fix a false positive for Rails/ReversibleMigrationMethodDefinition when using cbase migration class. (@koic)
  • #500: Fix a false positive for Rails/DynamicFindBy when using dynamic finder with hash argument. (@koic)

Changes

  • #288: Add AllowToTime option (true by default) to Rails/Date. (@koic)
  • #499: Add IgnoreWhereFirst option (true by default) to Rails/FindBy. (@koic)
  • #505: Set disabled by default for Rails/EnvironmentVariableAccess. (@koic)

RuboCop Rails 2.10.1

05 May 16:23
Compare
Choose a tag to compare

Bug fixes

  • #478: Fix Rails/ReversibleMigrationMethodDefinition cop's Include. (@rhymes)

RuboCop Rails 2.10.0

05 May 00:33
Compare
Choose a tag to compare

New features

Bug fixes

  • #421: Fix incorrect auto-correct for Rails/LinkToBlank when using target: '_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 using belongs_to lambda block with required 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 inheriting ActiveRecord::Base and using all.each. (@koic)
  • #466: Fix a false positive for Rails/DynamicFindBy when not inheriting ApplicationRecord and without no receiver. (@koic)
  • #147: Fix a false positive for Rails/HasManyOrHasOneDependent when specifying default dependent: nil strategy. (@koic)
  • #137: Make Rails/HasManyOrHasOneDependent aware of readonly? is true. (@koic)
  • #474: Fix a false negative for Rails/SafeNavigation when using try! without receiver. (@koic)
  • #126: Fix an incorrect auto-correct for Rails/SafeNavigation with Style/RedndantSelf. (@koic)
  • #476: Fix a false positive for Rails/ReversibleMigration when using drop_table with symbol proc. (@koic)

Changes

  • #409: Deconstruct "table.column" in Rails/WhereNot. (@mobilutz)
  • #416: Make Rails/HasManyOrHasOneDependent accept combination of association extension and with_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 for Lint/NumberConversion to allow Rails' duration methods. (@dvandersluis)
  • #444: Mark Rails/Blank as unsafe auto-correction. (@koic)
  • #451: Make Rails/RelativeDateConstant aware of yesterday and tomorrow 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 with to_s. (@koic)
  • #456: Drop Ruby 2.4 support. (@koic)
  • #462: Require RuboCop 1.7 or higher. (@koic)

RuboCop Rails 2.9.1

16 Dec 00:41
Compare
Choose a tag to compare

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

  • #404: Make Rails/HelperInstanceVariable accepts of instance variables when a class which inherits ActionView::Helpers::FormBuilder. (@koic)
  • #406: Deconstruct "table.column" in Rails/WhereEquals. (@mobilutz)

RuboCop Rails 2.9.0

08 Dec 16:58
Compare
Choose a tag to compare

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 in arel_table calls. (@flanger001)
  • #389: Add IgnoredMethods config option for Rails/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

15 Sep 15:08
Compare
Choose a tag to compare

Bug fixes

  • #345: Fix error of Rails/AfterCommitOverride on after_commit with a lambda. (@pocke)
  • #349: Fix errors of Rails/UniqueValidationWithoutIndex. (@Tietew)
  • #338: Fix a false positive for Rails/IndexBy and Rails/IndexWith when the each_with_object hash is used in the transformed key or value. (@eugeneius)
  • #351: Add <> operator to Rails/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 of change_column_default are in the order of to, from. (@koic)

RuboCop Rails 2.8.0

04 Sep 07:06
Compare
Choose a tag to compare

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 for remove_columns and remove_index. (@philcoggins)
  • #310: Add EnforcedStyle to Rails/PluckInWhere. By default, it does not register an offense if pluck method's receiver is a variable. (@koic)
  • #320: Mark Rails/UniqBeforePluck as unsafe auto-correction. (@kunitoo)
  • #324: Make Rails/IndexBy and Rails/IndexWith aware of to_h with block. (@eugeneius)
  • #341: Make Rails/WhereExists configurable to allow where(...).exists? to be the preferred style. (@dvandersluis)

RuboCop Rails 2.7.1

26 Jul 06:57
Compare
Choose a tag to compare

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 when via option is a variable. (@tejasbubane)

Changes

  • #301: Set disalbed by default for Rails/PluckId. (@koic)