90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/active_record/relation/delegation.rb', line 90
def delegate_to_scoped_klass(method)
@delegation_mutex.synchronize do
return if method_defined?(method)
if /\A[a-zA-Z_]\w*[!?]?\z/.match?(method)
module_eval " def \#{method}(*args, &block)\n scoping { @klass.\#{method}(*args, &block) }\n end\n RUBY\n else\n define_method method do |*args, &block|\n scoping { @klass.public_send(method, *args, &block) }\n end\n end\n end\nend\n", __FILE__, __LINE__ + 1
|