module ActiveRecord::DynamicMatchers

def method_missing(name, *arguments, &block)

def method_missing(name, *arguments, &block)
  match = Method.match(self, name)
  if match && match.valid?
    match.define
    send(name, *arguments, &block)
  else
    super
  end
end

def respond_to_missing?(name, _)

def respond_to_missing?(name, _)
  if self == Base
    super
  else
    match = Method.match(self, name)
    match && match.valid? || super
  end
end