Method: NinjaModel::Relation#method_missing

Defined in:
lib/ninja_model/relation.rb

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



90
91
92
93
94
95
96
97
98
99
100
# File 'lib/ninja_model/relation.rb', line 90

def method_missing(method, *args, &block)
  if Array.method_defined?(method)
    to_a.send(method, *args, &block)
  elsif @klass.singleton_class.respond_to?(method)
    merge(@klass.singleton_class.send(method, *args, &block))
  elsif @klass.respond_to?(method)
    scoping { @klass.send(method, *args, &block) }
  else
    super
  end
end