Sha256: 2a8adfa32e181958512a449ec830e08d60397e9a4528c42060609c966dd6e1c4
Contents?: true
Size: 1.11 KB
Versions: 25
Compression:
Stored size: 1.11 KB
Contents
module Picky module Query class IndexesCheck class << self # Returns the right combinations strategy for # a number of query indexes. # # Currently it isn't possible using Memory and Redis etc. # indexes in the same query index group. # # Picky will raise a Query::Indexes::DifferentBackendsError. # def check_backends indexes # :nodoc: backends = indexes.map &:backend backends.uniq! &:class raise_different backends if backends.size > 1 backends end def raise_different backends # :nodoc: raise DifferentBackendsError.new(backends) end end end # Currently it isn't possible using Memory and Redis etc. # indexes in the same query index group. # class DifferentBackendsError < StandardError # :nodoc:all def initialize backends @backends = backends end def to_s "Currently it isn't possible to mix Indexes with backends #{@backends.join(" and ")} in the same Search instance." end end end end
Version data entries
25 entries across 25 versions & 1 rubygems