aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/calculations_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-01-13 23:42:07 +0000
committerJon Leighton <j@jonathanleighton.com>2012-01-16 21:17:17 +0000
commitd13627d532f23b248a9141511c16abdf5746a486 (patch)
treeb307474e4ba22771acaedf9cba0a237e2219aad4 /activerecord/test/cases/calculations_test.rb
parent247d274cabae827766c1c5b9deb34fb34548fc5e (diff)
downloadrails-d13627d532f23b248a9141511c16abdf5746a486.tar.gz
rails-d13627d532f23b248a9141511c16abdf5746a486.tar.bz2
rails-d13627d532f23b248a9141511c16abdf5746a486.zip
Revert "Deprecate implicit eager loading. Closes #950."
This reverts commit c99d507fccca2e9e4d12e49b4387e007c5481ae9.
Diffstat (limited to 'activerecord/test/cases/calculations_test.rb')
-rw-r--r--activerecord/test/cases/calculations_test.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index 3f026e310f..66c801ca75 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -49,11 +49,11 @@ class CalculationsTest < ActiveRecord::TestCase
end
def test_should_get_maximum_of_field_with_include
- assert_equal 55, Account.eager_load(:firm).where("companies.name != 'Summit'").maximum(:credit_limit)
+ assert_equal 55, Account.maximum(:credit_limit, :include => :firm, :conditions => "companies.name != 'Summit'")
end
def test_should_get_maximum_of_field_with_scoped_include
- Account.eager_load(:firm).where("companies.name != 'Summit'").scoping do
+ Account.send :with_scope, :find => { :include => :firm, :conditions => "companies.name != 'Summit'" } do
assert_equal 55, Account.maximum(:credit_limit)
end
end
@@ -270,7 +270,7 @@ class CalculationsTest < ActiveRecord::TestCase
end
def test_should_not_modify_options_when_using_includes
- options = {:include => :firm}
+ options = {:conditions => 'companies.id > 1', :include => :firm}
options_copy = options.dup
Account.count(:all, options)
@@ -334,9 +334,7 @@ class CalculationsTest < ActiveRecord::TestCase
end
def test_should_perform_joined_include_when_referencing_included_tables
- joined_count = assert_deprecated do
- Account.includes(:firm).where(:companies => {:name => '37signals'}).count
- end
+ joined_count = Account.includes(:firm).where(:companies => {:name => '37signals'}).count
assert_equal 1, joined_count
end