diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-30 14:56:32 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-30 14:56:32 -0800 |
commit | 3ad0779e566067f26422a74f108d81ac458e4333 (patch) | |
tree | f9d5116eb7fb30753e5203e466ef45832a02c9fb | |
parent | 795dc3d15fee02c9ccc9da08c8fcee0830a4962a (diff) | |
download | rails-3ad0779e566067f26422a74f108d81ac458e4333.tar.gz rails-3ad0779e566067f26422a74f108d81ac458e4333.tar.bz2 rails-3ad0779e566067f26422a74f108d81ac458e4333.zip |
testing combined nodes are not traversed
-rw-r--r-- | activerecord/test/cases/relation_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb index cc2c2c1446..a9244ae65e 100644 --- a/activerecord/test/cases/relation_test.rb +++ b/activerecord/test/cases/relation_test.rb @@ -80,6 +80,15 @@ module ActiveRecord assert_equal({}, relation.where_values_hash) end + def test_tree_is_not_traversed + relation = Relation.new Post, Post.arel_table + left = relation.table[:id].eq(10) + right = relation.table[:id].eq(10) + combine = left.and right + relation.where_values << combine + assert_equal({}, relation.where_values_hash) + end + def test_table_name_delegates_to_klass relation = Relation.new FakeKlass.new('foo'), :b assert_equal 'foo', relation.table_name |