method
delegate_to_scoped_klass
v3.2.1 -
Show latest stable
- Class:
ActiveRecord::Delegation
delegate_to_scoped_klass(method)public
No documentation available.
# File activerecord/lib/active_record/relation/delegation.rb, line 10
def self.delegate_to_scoped_klass(method)
if method.to_s =~ /\A[a-zA-Z_]\w*[!?]?\z/
module_eval def #{method}(*args, &block) scoping { @klass.#{method}(*args, &block) } end, __FILE__, __LINE__ + 1
else
module_eval def #{method}(*args, &block) scoping { @klass.send(#{method.inspect}, *args, &block) } end, __FILE__, __LINE__ + 1
end
end