Skip to content

Commit d0dc3fb

Browse files
committed
Cut 2.33.3
1 parent 6ccab18 commit d0dc3fb

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
## master (unreleased)
1111

12+
## 2.33.3 (2025-08-14)
13+
1214
### Bug fixes
1315

1416
* [#1516](https://github.com/rubocop/rubocop-rails/pull/1516): Fix wrong autocorrect for `Rails/FindByOrAssignmentMemoization`. ([@earlopain][])

docs/antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name: rubocop-rails
22
title: RuboCop Rails
33
# We always provide version without patch here (e.g. 1.1),
44
# as patch versions should not appear in the docs.
5-
version: ~
5+
version: '2.33'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops_rails.adoc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2637,7 +2637,7 @@ or the code may have a different purpose than memoization.
26372637
26382638
[source,ruby]
26392639
----
2640-
# bad
2640+
# bad - exclusively doing memoization
26412641
def current_user
26422642
@current_user ||= User.find_by(id: session[:user_id])
26432643
end
@@ -2648,6 +2648,22 @@ def current_user
26482648
26492649
@current_user = User.find_by(id: session[:user_id])
26502650
end
2651+
2652+
# bad - method contains other code
2653+
def current_user
2654+
@current_user ||= User.find_by(id: session[:user_id])
2655+
@current_user.do_something
2656+
end
2657+
2658+
# good
2659+
def current_user
2660+
if defined?(@current_user)
2661+
@current_user
2662+
else
2663+
@current_user = User.find_by(id: session[:user_id])
2664+
end
2665+
@current_user.do_something
2666+
end
26512667
----
26522668
26532669
[#references-railsfindbyorassignmentmemoization]

lib/rubocop/rails/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module RuboCop
44
module Rails
55
# This module holds the RuboCop Rails version information.
66
module Version
7-
STRING = '2.33.2'
7+
STRING = '2.33.3'
88

99
def self.document_version
1010
STRING.match('\d+\.\d+').to_s

relnotes/v2.33.3.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Bug fixes
2+
3+
* [#1516](https://github.com/rubocop/rubocop-rails/pull/1516): Fix wrong autocorrect for `Rails/FindByOrAssignmentMemoization`. ([@earlopain][])
4+
5+
[@earlopain]: https://github.com/earlopain

0 commit comments

Comments
 (0)