Skip to content

Commit fd6d286

Browse files
authored
Merge pull request rails#27984 from kenta-s/remove-unused-variable
Refactor `test_find_by_does_not_use_statement_cache_if_table_name_is_changed`
2 parents efe121e + 8646911 commit fd6d286

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/test/cases/statement_cache_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ def test_unprepared_statements_dont_share_a_cache_with_prepared_statements
109109
def test_find_by_does_not_use_statement_cache_if_table_name_is_changed
110110
book = Book.create(name: "my book")
111111

112-
Book.find_by(name: "my book") # warming the statement cache.
112+
Book.find_by(name: book.name) # warming the statement cache.
113113

114114
# changing the table name should change the query that is not cached.
115115
Book.table_name = :birds
116-
assert_nil Book.find_by(name: "my book")
116+
assert_nil Book.find_by(name: book.name)
117117
ensure
118118
Book.table_name = :books
119119
end

0 commit comments

Comments
 (0)