aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-04-10 17:15:17 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-04-10 17:15:17 -0700
commit2d3969c82fd8aa57186c263afd4b2d93eb6ba5d3 (patch)
tree82bd3ce8e8fc30a52c2ee4d8624a8ebfab2427a3 /activerecord/test/cases
parent8de3c433ef21d325c9ab3072c75da4b3d9043d8d (diff)
downloadrails-2d3969c82fd8aa57186c263afd4b2d93eb6ba5d3.tar.gz
rails-2d3969c82fd8aa57186c263afd4b2d93eb6ba5d3.tar.bz2
rails-2d3969c82fd8aa57186c263afd4b2d93eb6ba5d3.zip
stop caching the class on the statement cache object
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/statement_cache_test.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/statement_cache_test.rb b/activerecord/test/cases/statement_cache_test.rb
index 1b7e5fc727..4c47c5a1fd 100644
--- a/activerecord/test/cases/statement_cache_test.rb
+++ b/activerecord/test/cases/statement_cache_test.rb
@@ -19,9 +19,9 @@ module ActiveRecord
Book.where(:name => params[:name])
end
- b = cache.execute name: "my book"
+ b = cache.execute({ name: "my book" }, Book, Book.connection)
assert_equal "my book", b[0].name
- b = cache.execute name: "my other book"
+ b = cache.execute({ name: "my other book" }, Book, Book.connection)
assert_equal "my other book", b[0].name
end
@@ -34,9 +34,9 @@ module ActiveRecord
Book.where(id: params[:id])
end
- b = cache.execute id: b1.id
+ b = cache.execute({ id: b1.id }, Book, Book.connection)
assert_equal b1.name, b[0].name
- b = cache.execute id: b2.id
+ b = cache.execute({ id: b2.id }, Book, Book.connection)
assert_equal b2.name, b[0].name
end
@@ -59,7 +59,7 @@ module ActiveRecord
Book.create(name: "my book", author_id: 4)
- books = cache.execute({})
+ books = cache.execute({}, Book, Book.connection)
assert_equal "my book", books[0].name
end
@@ -72,7 +72,7 @@ module ActiveRecord
molecule = salty.molecules.create(name: 'dioxane')
molecule.electrons.create(name: 'lepton')
- liquids = cache.execute({})
+ liquids = cache.execute({}, Book, Book.connection)
assert_equal "salty", liquids[0].name
end
@@ -85,13 +85,13 @@ module ActiveRecord
Book.create(name: "my book")
end
- first_books = cache.execute({})
+ first_books = cache.execute({}, Book, Book.connection)
3.times do
Book.create(name: "my book")
end
- additional_books = cache.execute({})
+ additional_books = cache.execute({}, Book, Book.connection)
assert first_books != additional_books
end
end