Skip to content

Commit f029fb0

Browse files
Neeraj Singhjonleighton
authored andcommitted
failing test for rails#9869
1 parent ba29581 commit f029fb0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

activerecord/test/cases/scoping/named_scoping_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,4 +459,9 @@ def test_eager_default_scope_relations_are_deprecated
459459
end
460460
assert_equal [posts(:welcome).title], klass.all.map(&:title)
461461
end
462+
463+
def test_subclass_merges_scopes_properly
464+
assert_equal 1, SpecialComment.crazy_all.count
465+
end
466+
462467
end

activerecord/test/models/comment.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def self.all_as_method
2929
end
3030

3131
class SpecialComment < Comment
32+
scope :crazy_all, -> { where(body: 'go crazy').created }
3233
end
3334

3435
class SubSpecialComment < SpecialComment

0 commit comments

Comments
 (0)