diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-10 17:20:22 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-10 17:20:22 -0700 |
commit | 249fd686fb86c89463d791f44114fd829cb05bd2 (patch) | |
tree | 310fbf4d9827beb4b16072a437ca7c375022a0b8 /activerecord/test | |
parent | 2d3969c82fd8aa57186c263afd4b2d93eb6ba5d3 (diff) | |
download | rails-249fd686fb86c89463d791f44114fd829cb05bd2.tar.gz rails-249fd686fb86c89463d791f44114fd829cb05bd2.tar.bz2 rails-249fd686fb86c89463d791f44114fd829cb05bd2.zip |
remove intelligence from StatementCache#initialize
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/statement_cache_test.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/test/cases/statement_cache_test.rb b/activerecord/test/cases/statement_cache_test.rb index 4c47c5a1fd..0455764f6c 100644 --- a/activerecord/test/cases/statement_cache_test.rb +++ b/activerecord/test/cases/statement_cache_test.rb @@ -15,7 +15,7 @@ module ActiveRecord Book.create(name: "my book") Book.create(name: "my other book") - cache = StatementCache.new do |params| + cache = StatementCache.create do |params| Book.where(:name => params[:name]) end @@ -30,7 +30,7 @@ module ActiveRecord b1 = Book.create(name: "my book") b2 = Book.create(name: "my other book") - cache = StatementCache.new do |params| + cache = StatementCache.create do |params| Book.where(id: params[:id]) end @@ -53,7 +53,7 @@ module ActiveRecord #End def test_statement_cache_with_simple_statement - cache = ActiveRecord::StatementCache.new do |params| + cache = ActiveRecord::StatementCache.create do |params| Book.where(name: "my book").where("author_id > 3") end @@ -64,7 +64,7 @@ module ActiveRecord end def test_statement_cache_with_complex_statement - cache = ActiveRecord::StatementCache.new do |params| + cache = ActiveRecord::StatementCache.create do |params| Liquid.joins(:molecules => :electrons).where('molecules.name' => 'dioxane', 'electrons.name' => 'lepton') end @@ -77,7 +77,7 @@ module ActiveRecord end def test_statement_cache_values_differ - cache = ActiveRecord::StatementCache.new do |params| + cache = ActiveRecord::StatementCache.create do |params| Book.where(name: "my book") end |