aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relations_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-30 12:26:38 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-30 13:20:54 -0700
commitcbca12f9086826dd7243c7c847deea89bbe026b1 (patch)
tree05e2106f4cdd36ae819270d27fbb7cb375101209 /activerecord/test/cases/relations_test.rb
parent7d5762d2c2147f8240614997682e5e535a3e4f33 (diff)
downloadrails-cbca12f9086826dd7243c7c847deea89bbe026b1.tar.gz
rails-cbca12f9086826dd7243c7c847deea89bbe026b1.tar.bz2
rails-cbca12f9086826dd7243c7c847deea89bbe026b1.zip
adding tests for #5234 and #5184. Tests were from Akira Matsuda. Thanks Akira!
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r--activerecord/test/cases/relations_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index d2ccc1480a..f4f3dc4d5a 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -500,6 +500,11 @@ class RelationTest < ActiveRecord::TestCase
end
end
+ def test_relation_merging_with_joins
+ comments = Comment.joins(:post).where(:body => 'Thank you for the welcome') & Post.where(:body => 'Such a lovely day')
+ assert_equal 1, comments.count
+ end
+
def test_count
posts = Post.scoped