From 5259062868dcf10fbcf735d6520e6a14e15fdcdb Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 9 Sep 2020 19:37:58 +0900 Subject: [PATCH] Test calculation with `from` for all adapters --- activerecord/test/cases/calculations_test.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index 7a26dba6b1..fb7c543b59 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -698,12 +698,10 @@ class CalculationsTest < ActiveRecord::TestCase assert_equal 7, Company.includes(:contracts).sum(:developer_id) end - if current_adapter?(:Mysql2Adapter) - def test_from_option_with_specified_index - assert_equal Edge.count(:all), Edge.from("edges USE INDEX(unique_edge_index)").count(:all) - assert_equal Edge.where("sink_id < 5").count(:all), - Edge.from("edges USE INDEX(unique_edge_index)").where("sink_id < 5").count(:all) - end + def test_from_option_with_specified_index + edges = Edge.from("edges /*! USE INDEX(unique_edge_index) */") + assert_equal Edge.count(:all), edges.count(:all) + assert_equal Edge.where("sink_id < 5").count(:all), edges.where("sink_id < 5").count(:all) end def test_from_option_with_table_different_than_class