lib/pg_search/multisearch/rebuilder.rb in pg_search-2.1.3 vs lib/pg_search/multisearch/rebuilder.rb in pg_search-2.1.4

- old
+ new

@@ -1,19 +1,21 @@ +# frozen_string_literal: true + module PgSearch module Multisearch class Rebuilder def initialize(model, time_source = Time.method(:now)) - raise ModelNotMultisearchable.new(model) unless model.respond_to?(:pg_search_multisearchable_options) + raise ModelNotMultisearchable, model unless model.respond_to?(:pg_search_multisearchable_options) @model = model @time_source = time_source end def rebuild if model.respond_to?(:rebuild_pg_search_documents) model.rebuild_pg_search_documents elsif conditional? || dynamic? - model.find_each { |record| record.update_pg_search_document } + model.find_each(&:update_pg_search_document) else model.connection.execute(rebuild_sql) end end