Sha256: 75f919a0b452786d7e2d54dca78efae61eca11b5da876ae1d4af86ac42fe526f
Contents?: true
Size: 310 Bytes
Versions: 7
Compression:
Stored size: 310 Bytes
Contents
require "active_record" module ActiveRecord module Solr def with_query(query) results = self.name.constantize.search { fulltext query }.results ids = results.inject([]) {|ids, record| ids << record.id} self.where(id: ids) end end end ActiveRecord::Base.extend ActiveRecord::Solr
Version data entries
7 entries across 7 versions & 1 rubygems