lib/pg_search/document.rb in pg_search-2.3.6 vs lib/pg_search/document.rb in pg_search-2.3.7
- old
+ new
@@ -1,28 +1,28 @@
# frozen_string_literal: true
-require 'logger'
+require "logger"
module PgSearch
- class Document < ActiveRecord::Base
+ class Document < ActiveRecord::Base # standard:disable Rails/ApplicationRecord
include PgSearch::Model
- self.table_name = 'pg_search_documents'
+ self.table_name = "pg_search_documents"
belongs_to :searchable, polymorphic: true
# The logger might not have loaded yet.
# https://github.com/Casecommons/pg_search/issues/26
def self.logger
super || Logger.new($stderr)
end
pg_search_scope :search, lambda { |*args|
options = if PgSearch.multisearch_options.respond_to?(:call)
- PgSearch.multisearch_options.call(*args)
- else
- { query: args.first }.merge(PgSearch.multisearch_options)
- end
+ PgSearch.multisearch_options.call(*args)
+ else
+ {query: args.first}.merge(PgSearch.multisearch_options)
+ end
- { against: :content }.merge(options)
+ {against: :content}.merge(options)
}
end
end