Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamic_finders_plus/method_missing_hook.rb

Class Method Summary collapse

Class Method Details

.b1862897f5d04bd5be5e76e0ba0812bcVObject



7
# File 'lib/dynamic_finders_plus/method_missing_hook.rb', line 7

alias b1862897f5d04bd5be5e76e0ba0812bcV method_missing

.method_missing(name, *args, &block) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/dynamic_finders_plus/method_missing_hook.rb', line 8

def method_missing name, *args, &block

  self.define_singleton_method :method_missing, method(:b1862897f5d04bd5be5e76e0ba0812bcV)
  if (new_methods = DynamicFindersPlus::Finder.define_for self) && (method = new_methods[name])
    method.call *args, &block
  else
    b1862897f5d04bd5be5e76e0ba0812bcV name, *args, &block
  end
end