Sha256: 2d0a33b003ed5af1f89716c1810cbc4814bd72007813f5c65fc3ff9bb5e4819a

Contents?: true

Size: 614 Bytes

Versions: 8

Compression:

Stored size: 614 Bytes

Contents

require "pg_search/multisearch/rebuilder"

module PgSearch
  module Multisearch
    class << self
      def rebuild(model, clean_up=true)
        model.transaction do
          PgSearch::Document.where(:searchable_type => model.base_class.name).delete_all if clean_up
          Rebuilder.new(model).rebuild
        end
      end
    end

    class ModelNotMultisearchable < StandardError
      def initialize(model_class)
        @model_class = model_class
      end

      def message
        "#{@model_class.name} is not multisearchable. See PgSearch::ClassMethods#multisearchable"
      end
    end
  end
end


Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pg_search-2.1.3 lib/pg_search/multisearch.rb
pg_search-2.1.2 lib/pg_search/multisearch.rb
pg_search-2.1.1 lib/pg_search/multisearch.rb
pg_search-2.1.0 lib/pg_search/multisearch.rb
pg_search-2.0.1 lib/pg_search/multisearch.rb
pg_search-2.0.0 lib/pg_search/multisearch.rb
pg_search-1.0.6 lib/pg_search/multisearch.rb
pg_search-1.0.5 lib/pg_search/multisearch.rb