Skip to content

Releases: rubocop/rubocop-rails

RuboCop Rails v2.35.3

27 May 03:55

Choose a tag to compare

Bug fixes

  • #1630: Fix a false positive in Rails/StrongParametersExpect when negating params[:key] with !, such as !params[:key]. (@koic)
  • #1629: Fix false positives in Rails/StrongParametersExpect when using the safe navigation operator (&.) on params[:key]. Autocorrecting params[:key]&.downcase to params.expect(:key).downcase silently changes behavior — a missing param goes from returning nil to raising ActionController::ParameterMissing. (@lucasmazza)

RuboCop Rails v2.35.2

19 May 09:19

Choose a tag to compare

Bug fixes

  • #1625: Fix false positives in Rails/StrongParametersExpect when using collection methods (such as delete, keys, merge, slice, dig, fetch, or transform_values) on params[:key], as well as block-style calls such as params[:key].each { ... } or params[:key].map(&:to_s). (@koic)
  • #1627: Fix false positives in Rails/StrongParametersExpect for usages like params[:key].try(:method) and params[:key].try!(:method). (@nicholasdower)

RuboCop Rails v2.35.1

17 May 06:16

Choose a tag to compare

Bug fixes

  • #1616: Fix false positives in Rails/StrongParametersExpect when using nil-safe conversion methods such as to_i, to_s, to_a, to_f, and to_h on params[:key]. (@koic)
  • #1622: Fix false positives in Rails/StrongParametersExpect when using key-check methods such as key?, has_key?, include?, and member? on params[:key]. (@koic)
  • #1620: Fix false positives in Rails/StrongParametersExpect when using type-check methods such as is_a?, kind_of?, and instance_of? on params[:key]. (@koic)

RuboCop Rails v2.35.0

09 May 10:03

Choose a tag to compare

Bug fixes

  • #1595: Fix a false negative for Rails/I18nLocaleTexts when using redirect_back_or_to with a flash message. (@55728)
  • #1587: Fix false positives for Rails/Presence with operator methods like <<, =~, and others. (@eugeneius)
  • #1586: Don't add unnecessary parentheses in Rails/Presence. (@eugeneius)
  • #1602: Fix an error in Rails/SelectMap when .select appears inside a subquery in an argument. (@koic)
  • #1604: Allow DatabaseTypeResolvable to fall back to an adapter configuration specified in a shared key. (@codergeek121)
  • #1582: Fix a false negative where local was incorrectly treated as a known environment name when using == comparison in Rails/UnknownEnv. (@lovro-bikic)

Changes

  • #1571: Add more detection patterns on Rails/ResponseParsedBody. (@r7kamura)
  • #1583: Extend Rails/StrongParametersExpect to detect params[:key] in method calls and raising finder methods. (@koic)
  • #1584: Add support for case statements to Rails/UnknownEnv. (@lovro-bikic)
  • #1592: Fix false negative for != comparison in Rails/UnknownEnv. (@lovro-bikic)
  • #1598: Use glob patterns compatible with Engine or Packwerk for cops targeting spec/ and test/ directories. (@y-yagi)

RuboCop Rails v2.34.3

03 Jan 08:04

Choose a tag to compare

Bug fixes

  • #1473: Fix an error for Rails/SelectMap when select(:column_name).map(&:column_name) with parentheses. (@koic)
  • #1569: Fix an error in Rails/SelectMap when multiple select calls are present before map. (@koic)

RuboCop Rails v2.34.2

29 Nov 08:15

Choose a tag to compare

Changes

  • #1565: Make Rails/Presence allow index access methods. (@koic)

RuboCop Rails v2.34.1

24 Nov 07:46

Choose a tag to compare

Bug fixes

  • #1556: Fix an error for Rails/Env when assigning Rails.env. (@koic)
  • #1557: Fix false positives for Rails/Presence with comparison and assignment operators. (@davidenglishmusic)
  • #1558: This PR fixes incorrect autocorrect for Rails/RedirectBackOrTo when additional options as double splat are used. (@koic)
  • #1561: Fix incorrect autocorrect for Rails/RedirectBackOrTo when fallback_location argument is a hash and the call has no argument parentheses. (@koic)

RuboCop Rails v2.34.0

16 Nov 07:35

Choose a tag to compare

New features

  • #1520: New Rails/HttpStatusNameConsistency cop. (@tuxagon)
  • #1376: Add new Rails/Env cop. (@cdudas17)
  • #1541: Add new Rails/RedirectBackOrTo cop to suggest using redirect_back_or_to instead of redirect_back with fallback_location. (@davidenglishmusic)

Bug fixes

  • #1539: Fix an error in Rails/ActionControllerFlashBeforeRender when flash is used inside a block followed by method chaining. (@koic)
  • #1553: Fix false positives for Rails/OutputSafety when using non-interpolated multiline heredoc. (@koic)
  • #1532: Fix false positives for Rails/FindByOrAssignmentMemoization when assigning a memoization instance variable at initialize method. (@koic)
  • #1549: Fix Rails/InverseOf cop false positives when using dynamic association options. (@viralpraxis)

Changes

RuboCop Rails v2.33.4

27 Sep 06:27

Choose a tag to compare

Bug fixes

  • #1530: Fix an incorrect autocorrect for Rails/FindByOrAssignmentMemoization when using endless method definition. (@koic)
  • #1522: Fix an error for Rails/FindBy when where takes a block. (@earlopain)
  • #1182: Fix a false positive for Rails/ActionControllerFlashBeforeRender when flash is called in a block. (@5hun-s)

RuboCop Rails v2.33.3

13 Aug 15:19

Choose a tag to compare

Bug fixes

  • #1516: Fix wrong autocorrect for Rails/FindByOrAssignmentMemoization. (@earlopain)