Skip to content

Latest commit

 

History

History
486 lines (338 loc) · 31.7 KB

CHANGELOG.md

File metadata and controls

486 lines (338 loc) · 31.7 KB

Change log

master (unreleased)

2.12.4 (2021-10-16)

Bug fixes

  • #573: Fix an error for Rails/FindEach when using where with no receiver. (@koic)

2.12.3 (2021-10-06)

Bug fixes

  • #556: Fix a false positive for Rails/ContentTag when using using the tag method with 3 or more arguments. (@koic)
  • #551: Fix a false positive for Rails/FindEach when using model.errors.where in Rails 6.1. (@koic)
  • #543: Fix an error for Rails/ContentTag when tag is not a top-level method. (@koic)
  • #559: Fix an error for Rails/RelativeDateConstant when using multiple assignment. (@koic)
  • #553: Fix a false positive for Rails/ReversibleMigration when using t.remove with type option in Rails 6.1. (@koic)

Changes

  • #546: Exclude app/models by default for Rails/ContentTag. (@koic)
  • #570: Make Rails/CreateTableWithTimestamps respect active_storage_variant_records table of db/migrate/*_create_active_storage_tables.active_storage.rb auto-generated by bin/rails active_storage:install even if created_at is not specified. (@koic)

2.12.2 (2021-09-11)

Bug fixes

  • #541: Fix an error for Rails/HasManyOrHasOneDependent when using lambda argument and specifying :dependent strategy. (@koic)

2.12.1 (2021-09-10)

Bug fixes

  • #535: Fix an error for Rails/HasManyOrHasOneDependent when using lambda argument and not specifying any options. (@koic)

2.12.0 (2021-09-09)

New features

  • #521: Support auto-correction for Rails/Output. (@koic)
  • #520: Support auto-correction for Rails/ScopeArgs. (@koic)
  • #524: Add new Rails/RedundantTravelBack cop. (@koic)

Bug fixes

  • #528: Fix a false positive for Rails/HasManyOrHasOneDependent when specifying :dependent strategy with double splat. (@koic)
  • #529: Fix a false positive for Rails/LexicallyScopedActionFilter when action method is aliased by alias_method. (@koic)
  • #532: Fix a false positive for Rails/HttpPositionalArguments when defining get in Rails.application.routes.draw block. (@koic)

Changes

  • #260: Change target of Rails/ContentTag from content_tag method to tag method. (@tabuchi0919)

2.11.3 (2021-07-11)

Bug fixes

  • #517: Fix an issue for Rails/UniqueValidationWithoutIndex when validating uniqueness with a polymorphic scope. (@theunraveler)

2.11.2 (2021-07-02)

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)

2.11.1 (2021-06-25)

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)

2.11.0 (2021-06-21)

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)

2.10.1 (2021-05-06)

Bug fixes

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

2.10.0 (2021-05-05)

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)

2.9.1 (2020-12-16)

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)

2.9.0 (2020-12-09)

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)

2.8.1 (2020-09-16)

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)

2.8.0 (2020-09-04)

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)

2.7.1 (2020-07-26)

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 disabled by default for Rails/PluckId. (@koic)

2.7.0 (2020-07-21)

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)

2.6.0 (2020-06-08)

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)

2.5.2 (2020-04-09)

Bug fixes

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

2.5.1 (2020-04-02)

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)

2.5.0 (2020-03-24)

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)

2.4.2 (2020-01-26)

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)

2.4.1 (2019-12-25)

Bug fixes

  • #170: Make Rails/BulkChangeTable not suggest combining methods with an intervening block. (@mvz)
  • #159: Fix autocorrect for Rails/EnumHash when using % arrays notations. (@ngouy)

Changes

  • #166: Add db/schema.rb and bin/* to the excluded files. (@fidalgo)

2.4.0 (2019-11-27)

New features

  • #123: Add new Rails/ApplicationController and Rails/ApplicationMailer cops. (@eugeneius)
  • #130: Add new Rails/RakeEnvironment cop. (@pocke)
  • #133: Add new Rails/SafeNavigationWithBlank cop. (@gyfis)

Bug fixes

  • #120: Fix message for Rails/SaveBang when the save is in the body of a conditional. (@jas14)
  • #131: Fix an incorrect autocorrect for Rails/Presence when using [] method. (@forresty)
  • #142: Fix an incorrect autocorrect for Rails/EnumHash when using nested constants. (@koic)
  • #136: Fix a false positive for Rails/ReversibleMigration when using change_default with :from and :to options. (@sinsoku)
  • #144: Fix a false positive for Rails/ReversibleMigration when using change_table_comment or change_column_comment with a :from and :to hash. (@DNA)

Changes

  • #156: Make Rails/UnknownEnv cop aware of Rails.env == 'unknown_env'. (@pocke)
  • #141: Change default of EnforcedStyle from arguments to slashes for Rails/FilePath. (@koic)

2.3.2 (2019-09-01)

Bug fixes

  • #118: Fix an incorrect autocorrect for Rails/Validation when attributes are specified with array literal. (@koic)
  • #116: Fix an incorrect autocorrect for Rails/Presence when else branch of ternary operator is not nil. (@koic)

2.3.1 (2019-08-26)

Bug fixes

  • #104: Exclude Rails-independent bin/bundle by default. (@koic)
  • #107: Fix style guide URLs when specifying rubocop --display-style-guide option. (@koic)
  • #111: Fix an incorrect autocorrect for Rails/Presence when method arguments of else branch is not enclosed in parentheses. (@koic)

2.3.0 (2019-08-13)

New features

Bug fixes

  • #53: Fix a false positive for Rails/SaveBang when implicitly return using finder method and creation method connected by ||. (@koic)
  • #97: Fix two false negatives for Rails/EnumUniqueness. 1. When enum name is not a literal. 2. When enum has multiple definitions. (@santib)

Changes

2.2.1 (2019-07-13)

Bug fixes

  • #86: Fix an incorrect auto-correct for Rails/TimeZone when using Time.new. (@koic)

2.2.0 (2019-07-07)

Bug fixes

  • #67: Fix an incorrect auto-correct for Rails/TimeZone when using DateTime. (@koic)

2.1.0 (2019-06-26)

Bug fixes

  • #43: Remove change_column_null method from BulkChangeTable cop offenses. (@anthony-robin)
  • #79: Fix RuboCop::Cop::Rails not defined (NameError). (@rmm5t)

Changes

2.0.1 (2019-06-08)

Changes

2.0.0 (2019-05-22)

New features

  • Extract Rails cops from rubocop/rubocop repository. (@koic)
  • #19: Add new Rails/HelperInstanceVariable cop. (@andyw8)