Skip to content

Commit 9588924

Browse files
Update test name to reflect change in how scopes merging works
Introduced in f1082b8. Full changelog in 9f007d7. [ci skip]
1 parent 9f007d7 commit 9588924

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

activerecord/lib/active_record/scoping/named.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ def scope(name, body, &block)
167167
scope = relation.merge(scope)
168168
scope.default_scoped = default_scoped
169169
end
170-
171170
else
172171
scope = body
173172
end

activerecord/test/cases/named_scope_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def test_chaining_with_duplicate_joins
309309
assert_equal post.comments.size, Post.joins(join).joins(join).where("posts.id = #{post.id}").size
310310
end
311311

312-
def test_chaining_should_use_latest_conditions_when_creating
312+
def test_chaining_applies_last_conditions_when_creating
313313
post = Topic.rejected.new
314314
assert !post.approved?
315315

@@ -323,7 +323,7 @@ def test_chaining_should_use_latest_conditions_when_creating
323323
assert post.approved?
324324
end
325325

326-
def test_chaining_should_use_latest_conditions_when_searching
326+
def test_chaining_combines_conditions_when_searching
327327
# Normal hash conditions
328328
assert_equal Topic.where(approved: false).where(approved: true).to_a, Topic.rejected.approved.to_a
329329
assert_equal Topic.where(approved: true).where(approved: false).to_a, Topic.approved.rejected.to_a

0 commit comments

Comments
 (0)