Class: Toller::Sorts::ScopeHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/toller/sorts/scope_handler.rb

Overview

Scope handler for sort

Instance Method Summary collapse

Instance Method Details

#call(collection, direction, properties) ⇒ Object



9
10
11
12
13
# File 'lib/toller/sorts/scope_handler.rb', line 9

def call(collection, direction, properties)
  scoped_name = properties[:scope_name] || properties[:field]

  collection.public_send(scoped_name, direction)
end