1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Refactor test_find_by_does_not_use_statement_cache_if_table_name_is_changed

This commit is contained in:
kenta-s 2017-02-13 19:27:30 +09:00
parent efe121eab0
commit 8646911292

View file

@ -109,11 +109,11 @@ module ActiveRecord
def test_find_by_does_not_use_statement_cache_if_table_name_is_changed
book = Book.create(name: "my book")
Book.find_by(name: "my book") # warming the statement cache.
Book.find_by(name: book.name) # warming the statement cache.
# changing the table name should change the query that is not cached.
Book.table_name = :birds
assert_nil Book.find_by(name: "my book")
assert_nil Book.find_by(name: book.name)
ensure
Book.table_name = :books
end