Module: Searchlogic::Search::Ordering

Included in:
Searchlogic::Search
Defined in:
lib/searchlogic/search/ordering.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) ordering_by

Returns the column we are currently ordering by



5
6
7
# File 'lib/searchlogic/search/ordering.rb', line 5

def ordering_by
  @ordering_by ||= order && order.to_s.match(/^(ascend|descend)_by_(.*)$/).try(:[], 2)
end

- (Object) ordering_direction



9
10
11
# File 'lib/searchlogic/search/ordering.rb', line 9

def ordering_direction
  @ordering_direction ||= order && order.to_s.match(/^(ascend|descend)_by_/).try(:[], 1)
end