Module: Card::Query::CachedCountSorting

Defined in:
lib/card/query/cached_count_sorting.rb

Instance Method Summary collapse

Instance Method Details

#sort_by_count_cached_count(val) ⇒ Object



6
7
8
9
10
11
# File 'lib/card/query/cached_count_sorting.rb', line 6

def sort_by_count_cached_count val
  count_join = CachedCountJoin.new self, val[:right]
  joins << count_join
  @mods[:sort_as] = "integer"
  @mods[:sort] = "#{count_join.to_alias}.value"
end