cirandas.net

ref: master

plugins/pg_search/lib/ext/kind.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require_dependency 'kind'

Kind.class_eval do
  # Use count_without_distinct
  scope :pg_search_plugin_facets, -> scope {
    joins(:profiles).
    where('profiles.id' => scope.map(&:id)).
    group('kinds.id')
  }
end