Skip to content

Releases: rubocop/rubocop-rails

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)

RuboCop Rails 2.7.0

20 Jul 16:18
Compare
Choose a tag to compare

New features

Bug fixes

  • #261: Fix auto correction for Rails/ContentTag when content_tag is called with options hash and block. (@fatkodima)

Changes

  • #263: Change terminology to ForbiddenMethods and AllowedMethods. (@jcoyne)
  • #289: Update Rails/SkipsModelValidations to register an offense for insert_all, touch_all, upsert_all, etc. (@eugeneius)
  • #293: Require RuboCop 0.87 or higher. (@koic)

RuboCop Rails 2.6.0

08 Jun 06:47
Compare
Choose a tag to compare

New features

Bug fixes

  • #12: Fix a false positive for Rails/SkipsModelValidations when passing a boolean literal to touch. (@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 when update is called on ENV. (@eugeneius)
  • #251: Fix a false positive for Rails/FilePath when the result of Rails.root.join is interpolated at the end of a string. (@eugeneius)
  • #91: Fix Rails/UniqBeforePluck to not recommend using uniq in ActiveRecord::Relations anymore since it was deprecated in Rails 5.0. (@santib, @ghiculescu)

Changes

  • #233: (BREAKING) Drop support for Ruby 2.3. (@koic)
  • #236: (BREAKING) Drop support for Rails 4.1 or lower. (@koic)
  • #210: Accept redirecto_to(...) and return and similar cases. (@koic)
  • #258: Drop support for RuboCop 0.81 or lower. (@koic)

RuboCop Rails 2.5.2

09 Apr 10:40
Compare
Choose a tag to compare

Bug fixes

  • #227: Make Rails/UniqueValidationWithoutIndex aware of updating db/schema.rb. (@koic)

RuboCop Rails 2.5.1

02 Apr 11:00
Compare
Choose a tag to compare

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/UniqueValidationWithoutIndexwhen a table has no column definition. (@koic)
  • #221: Make Rails/UniqueValidationWithoutIndex aware of add_index in db/schema.rb. (@koic)

Changes

  • #223: Mark Rails/ApplicationController, Rails/ApplicationJob, Rails/ApplicationMailer, and Rails/ApplicationRecord as unsafe autocorrect. (@hoshinotsuyoshi)

RuboCop Rails 2.5.0

23 Mar 15:41
Compare
Choose a tag to compare

New features

  • #197: Add Rails/UniqueValidationWithoutIndex cop. (@pocke)
  • #208: Add new Rails/IndexBy and Rails/IndexWith cops. (@djudd, @eugeneius)
  • #150: Add EnforcedStyle: refute for Rails/RefuteMethods cop. (@koic)

Bug fixes

  • #180: Fix a false positive for HttpPositionalArguments when using get method with :to option. (@koic)
  • #193: Make Rails/EnvironmentComparison aware of Rails.env is used in RHS or when != is used for comparison. (@koic)
  • #205: Make Rails/ReversibleMigration aware of :to_table option of remove_foreign_key. (@joshpencheon)
  • #207: Fix a false positive for Rails/RakeEnvironment when using Capistrano. (@sinsoku)

RuboCop Rails 2.4.2

26 Jan 07:47
Compare
Choose a tag to compare

Bug fixes

  • #184: Fix Rake/Environment to allow task with no block. (@hanachin)
  • #122: Fix Exclude paths that were not inherited. (@koic)
  • #187: Fix an issue that excluded files in rubocop-rails did not work. (@sinsoku)
  • #190: Fix Rails/SaveBang when return value is checked immediately. (@jas14)