diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2011-12-17 14:41:17 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2011-12-17 14:41:17 +0300 |
commit | 04cea56d89e71dbb25dc888d8f855ba18025ccca (patch) | |
tree | f52d503896b7c14b0cd92a2566ef1aea6c94e20c /activerecord/test/cases | |
parent | 1bfed9efb39f4a8eff2867bb1d8b9e19ecc8ca02 (diff) | |
download | rails-04cea56d89e71dbb25dc888d8f855ba18025ccca.tar.gz rails-04cea56d89e71dbb25dc888d8f855ba18025ccca.tar.bz2 rails-04cea56d89e71dbb25dc888d8f855ba18025ccca.zip |
call scope within unscoped to prevent duplication of where values
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/named_scope_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb index 4a09a87322..0eb3d900bd 100644 --- a/activerecord/test/cases/named_scope_test.rb +++ b/activerecord/test/cases/named_scope_test.rb @@ -337,6 +337,11 @@ class NamedScopeTest < ActiveRecord::TestCase end end + def test_should_not_duplicates_where_values + where_values = Topic.where("1=1").scope_with_lambda.where_values + assert_equal ["1=1"], where_values + end + def test_chaining_with_duplicate_joins join = "INNER JOIN comments ON comments.post_id = posts.id" post = Post.find(1) |