mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
5e0b555b45
It looks like the only reason `current_scope` was thread local on `base_class` instead of `self` is to ensure that when we call a named scope created with a proc on the parent class, it correctly uses the default scope of the subclass. The reason this wasn't happening was because the proc captured `self` as the parent class, and we're not actually defining a real method. Using `instance_exec` fixes the problem. Fixes #18806 |
||
---|---|---|
.. | ||
default_scoping_test.rb | ||
named_scoping_test.rb | ||
relation_scoping_test.rb |