lib/searchkick.rb in searchkick-2.2.1 vs lib/searchkick.rb in searchkick-2.3.0
- old
+ new
@@ -34,19 +34,20 @@
class InvalidQueryError < Elasticsearch::Transport::Transport::Errors::BadRequest; end
class DangerousOperation < Error; end
class ImportError < Error; end
class << self
- attr_accessor :search_method_name, :wordnet_path, :timeout, :models, :client_options, :redis, :index_suffix
+ attr_accessor :search_method_name, :wordnet_path, :timeout, :models, :client_options, :redis, :index_suffix, :queue_name
attr_writer :client, :env, :search_timeout
attr_reader :aws_credentials
end
self.search_method_name = :search
self.wordnet_path = "/var/lib/wn_s.pl"
self.timeout = 10
self.models = []
self.client_options = {}
+ self.queue_name = :searchkick
def self.client
@client ||= begin
require "typhoeus/adapters/faraday" if defined?(Typhoeus)
@@ -204,6 +205,9 @@
end
end
# TODO find better ActiveModel hook
ActiveModel::Callbacks.send(:include, Searchkick::Model)
-ActiveRecord::Base.send(:extend, Searchkick::Model) if defined?(ActiveRecord)
+
+ActiveSupport.on_load(:active_record) do
+ extend Searchkick::Model
+end