Method: MongoMapper::Document::ClassMethods#method_missing

Defined in:
lib/mongo_mapper/document.rb

#method_missing(method, *args) ⇒ Object (protected)



320
321
322
323
324
325
326
327
328
329
# File 'lib/mongo_mapper/document.rb', line 320

def method_missing(method, *args)
  finder = DynamicFinder.new(method)

  if finder.found?
    meta_def(finder.method) { |*args| dynamic_find(finder, args) }
    send(finder.method, *args)
  else
    super
  end
end