Skip to content

Commit 43f1c26

Browse files
committed
Merge branch 'master' into feature/support-geospatial
2 parents 0593e83 + 8e3fd5b commit 43f1c26

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

test/cases/relations_test.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
require "cases/helper"
4+
require "models/post"
5+
require "models/comment"
6+
7+
module CockroachDB
8+
class RelationTest < ActiveRecord::TestCase
9+
fixtures :posts, :comments
10+
11+
def test_finding_with_subquery_with_eager_loading_in_from
12+
relation = Comment.includes(:post).where("posts.type": "Post").order(:id)
13+
assert_equal relation.to_a, Comment.select("*").from(relation).order(:id).to_a
14+
assert_equal relation.to_a, Comment.select("subquery.*").from(relation).order(:id).to_a
15+
assert_equal relation.to_a, Comment.select("a.*").from(relation, :a).order(:id).to_a
16+
end
17+
end
18+
end

test/excludes/RelationTest.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
exclude :test_finding_with_sanitized_order, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
2+
exclude :test_finding_with_subquery_with_eager_loading_in_from, "Overridden because test depends on ordering of results."

0 commit comments

Comments
 (0)