Class: DynamicDefaultScoping::Relation

Inherits:
ActiveRecord::Relation
  • Object
show all
Defined in:
lib/dynamic_default_scoping.rb

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



61
62
63
64
65
66
67
# File 'lib/dynamic_default_scoping.rb', line 61

def method_missing method, *args, &block
  if @klass.scopes[method].present?
    merge @klass.unscoped { @klass.send method, *args, &block }
  else
    super
  end
end