lib/pg_search/multisearch/rebuilder.rb in pg_search-2.3.2 vs lib/pg_search/multisearch/rebuilder.rb in pg_search-2.3.3
- old
+ new
@@ -28,11 +28,11 @@
model.pg_search_multisearchable_options.key?(:if) || model.pg_search_multisearchable_options.key?(:unless)
end
def dynamic?
column_names = model.columns.map(&:name)
- columns.any? { |column| !column_names.include?(column.to_s) }
+ columns.any? { |column| column_names.exclude?(column.to_s) }
end
def additional_attributes?
model.pg_search_multisearchable_options.key?(:additional_attributes)
end
@@ -44,10 +44,10 @@
def primary_key
model.primary_key
end
def rebuild_sql_template
- <<-SQL.strip_heredoc
+ <<~SQL.squish
INSERT INTO :documents_table (searchable_type, searchable_id, content, created_at, updated_at)
SELECT :base_model_name AS searchable_type,
:model_table.#{primary_key} AS searchable_id,
(
:content_expressions