Sha256: 3bb68677ad4df3663e1ca41b5ec58803f67b296941b610807f143055422186b2
Contents?: true
Size: 539 Bytes
Versions: 17
Compression:
Stored size: 539 Bytes
Contents
# frozen_string_literal: true class ThinkingSphinx::Middlewares::ValidOptions < ThinkingSphinx::Middlewares::Middleware def call(contexts) contexts.each { |context| check_options context.search.options } app.call contexts end private def check_options(options) unknown = invalid_keys options.keys return if unknown.empty? ThinkingSphinx::Logger.log :caution, "Unexpected search options: #{unknown.inspect}" end def invalid_keys(keys) keys - ThinkingSphinx::Search.valid_options end end
Version data entries
17 entries across 17 versions & 1 rubygems