module ActiveRecord::Delegation::ClassSpecificRelation
def method_missing(method, *args, &block)
def method_missing(method, *args, &block) if @klass.respond_to?(method) @klass.generate_relation_method(method) scoping { @klass.public_send(method, *args, &block) } else super end end