class ActiveRecord::Delegation::GeneratedRelationMethods

:nodoc:

def generate_method(method)

def generate_method(method)
  synchronize do
    return if method_defined?(method)
    if /\A[a-zA-Z_]\w*[!?]?\z/.match?(method) && !DELEGATION_RESERVED_METHOD_NAMES.include?(method.to_s)
      module_eval <<-RUBY, __FILE__, __LINE__ + 1
        def #{method}(...)
          scoping { klass.#{method}(...) }
        end
      RUBY
    else
      define_method(method) do |*args, &block|
        scoping { klass.public_send(method, *args, &block) }
      end
      ruby2_keywords(method)
    end
  end
end