mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Test calculation with from
for all adapters
This commit is contained in:
parent
f7b1582435
commit
5259062868
1 changed files with 4 additions and 6 deletions
|
@ -698,12 +698,10 @@ class CalculationsTest < ActiveRecord::TestCase
|
||||||
assert_equal 7, Company.includes(:contracts).sum(:developer_id)
|
assert_equal 7, Company.includes(:contracts).sum(:developer_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
if current_adapter?(:Mysql2Adapter)
|
def test_from_option_with_specified_index
|
||||||
def test_from_option_with_specified_index
|
edges = Edge.from("edges /*! USE INDEX(unique_edge_index) */")
|
||||||
assert_equal Edge.count(:all), Edge.from("edges USE INDEX(unique_edge_index)").count(:all)
|
assert_equal Edge.count(:all), edges.count(:all)
|
||||||
assert_equal Edge.where("sink_id < 5").count(:all),
|
assert_equal Edge.where("sink_id < 5").count(:all), edges.where("sink_id < 5").count(:all)
|
||||||
Edge.from("edges USE INDEX(unique_edge_index)").where("sink_id < 5").count(:all)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_from_option_with_table_different_than_class
|
def test_from_option_with_table_different_than_class
|
||||||
|
|
Loading…
Reference in a new issue