Class: QueryableWith::ImplicitScopeParameter

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(scope) ⇒ ImplicitScopeParameter

Returns a new instance of ImplicitScopeParameter.



106
107
108
# File 'lib/queryable_with.rb', line 106

def initialize(scope)
  @scope = scope
end

Instance Method Details

#query(queryer, params = {}) ⇒ Object



110
111
112
113
114
115
116
# File 'lib/queryable_with.rb', line 110

def query(queryer, params={})
  if @scope.is_a? Symbol
    queryer.send @scope, params
  else
    queryer.scoped @scope
  end
end