From 9c3afdc327132c7f1f4d05eebc0c05b715442e7d Mon Sep 17 00:00:00 2001 From: Jefferson Lai Date: Mon, 10 Feb 2014 03:00:05 -0800 Subject: Fixes Issue #13466. Changed the call to a scope block to be evaluated with instance_eval. The result is that ScopeRegistry can use the actual class instead of base_class when caching scopes so queries made by classes with a common ancestor won't leak scopes. --- activerecord/test/models/comment.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/test/models/comment.rb') diff --git a/activerecord/test/models/comment.rb b/activerecord/test/models/comment.rb index ede5fbd0c6..6a9dfacf56 100644 --- a/activerecord/test/models/comment.rb +++ b/activerecord/test/models/comment.rb @@ -35,4 +35,5 @@ class SubSpecialComment < SpecialComment end class VerySpecialComment < Comment + scope :special_parent, -> (special_rating) { where parent_id: special_rating.special_comment.id } end -- cgit v1.2.3