aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-08 09:32:36 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-08 09:34:33 -0300
commit958892444067fcd522920bd1b4ae02ec133b5cdd (patch)
treec7340c603af9c79e89acc5dfa3c1b647cd40ab1c
parent9f007d7fe5f90257c71baa2c4e7c76fb44512986 (diff)
downloadrails-958892444067fcd522920bd1b4ae02ec133b5cdd.tar.gz
rails-958892444067fcd522920bd1b4ae02ec133b5cdd.tar.bz2
rails-958892444067fcd522920bd1b4ae02ec133b5cdd.zip
Update test name to reflect change in how scopes merging works
Introduced in f1082b8588a9144eedb34d511f0074031f692d98. Full changelog in 9f007d7fe5f90257c71baa2c4e7c76fb44512986. [ci skip]
-rw-r--r--activerecord/lib/active_record/scoping/named.rb1
-rw-r--r--activerecord/test/cases/named_scope_test.rb4
2 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb
index 708b27dd7e..12317601b6 100644
--- a/activerecord/lib/active_record/scoping/named.rb
+++ b/activerecord/lib/active_record/scoping/named.rb
@@ -167,7 +167,6 @@ module ActiveRecord
scope = relation.merge(scope)
scope.default_scoped = default_scoped
end
-
else
scope = body
end
diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb
index c067db4cbe..b593270352 100644
--- a/activerecord/test/cases/named_scope_test.rb
+++ b/activerecord/test/cases/named_scope_test.rb
@@ -309,7 +309,7 @@ class NamedScopeTest < ActiveRecord::TestCase
assert_equal post.comments.size, Post.joins(join).joins(join).where("posts.id = #{post.id}").size
end
- def test_chaining_should_use_latest_conditions_when_creating
+ def test_chaining_applies_last_conditions_when_creating
post = Topic.rejected.new
assert !post.approved?
@@ -323,7 +323,7 @@ class NamedScopeTest < ActiveRecord::TestCase
assert post.approved?
end
- def test_chaining_should_use_latest_conditions_when_searching
+ def test_chaining_combines_conditions_when_searching
# Normal hash conditions
assert_equal Topic.where(approved: false).where(approved: true).to_a, Topic.rejected.approved.to_a
assert_equal Topic.where(approved: true).where(approved: false).to_a, Topic.approved.rejected.to_a