diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-19 00:36:30 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-19 21:01:27 -0300 |
commit | 60ffe41980f3989637bdf537341288288aa9cc39 (patch) | |
tree | 2baf95fdcd21a9b2e551ef73cc3f12687588d07e /activerecord/test | |
parent | 1f98493e4a3c53e53666ff740860b20dcd6d08ec (diff) | |
download | rails-60ffe41980f3989637bdf537341288288aa9cc39.tar.gz rails-60ffe41980f3989637bdf537341288288aa9cc39.tar.bz2 rails-60ffe41980f3989637bdf537341288288aa9cc39.zip |
Extract conditional to a method to avoid duplication
Also use if/else block to not use short circuit return
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/calculations_test.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index abb25fa63a..f748b897ee 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -423,6 +423,7 @@ class CalculationsTest < ActiveRecord::TestCase def test_maximum_with_not_auto_table_name_prefix_if_column_included Company.create!(:name => "test", :contracts => [Contract.new(:developer_id => 7)]) + # TODO: Investigate why PG isn't being typecast if current_adapter?(:PostgreSQLAdapter) assert_equal "7", Company.includes(:contracts).maximum(:developer_id) else @@ -433,6 +434,7 @@ class CalculationsTest < ActiveRecord::TestCase def test_minimum_with_not_auto_table_name_prefix_if_column_included Company.create!(:name => "test", :contracts => [Contract.new(:developer_id => 7)]) + # TODO: Investigate why PG isn't being typecast if current_adapter?(:PostgreSQLAdapter) assert_equal "7", Company.includes(:contracts).minimum(:developer_id) else @@ -443,6 +445,7 @@ class CalculationsTest < ActiveRecord::TestCase def test_sum_with_not_auto_table_name_prefix_if_column_included Company.create!(:name => "test", :contracts => [Contract.new(:developer_id => 7)]) + # TODO: Investigate why PG isn't being typecast if current_adapter?(:MysqlAdapter) || current_adapter?(:PostgreSQLAdapter) assert_equal "7", Company.includes(:contracts).sum(:developer_id) else |