Issue 13466: Named scopes evaluated with instance_eval. ScopeRegistry uses class instead of base_class