From e59b7fcd18abdc166d01bd95113127be33dbfa0c Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 24 Jun 2025 10:45:11 +0200 Subject: [PATCH] Format --- app/models/card/searchable.rb | 2 +- app/models/concerns/searchable.rb | 8 ++++---- ...0250624055720_add_description_to_cards_search_index.rb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/card/searchable.rb b/app/models/card/searchable.rb index d9c84709f..4d926854c 100644 --- a/app/models/card/searchable.rb +++ b/app/models/card/searchable.rb @@ -19,7 +19,7 @@ module Card::Searchable private # TODO: Temporary until we stabilize the search API def title_and_description - [title, description.to_plain_text].join(" ") + [ title, description.to_plain_text ].join(" ") end def search_embedding_content diff --git a/app/models/concerns/searchable.rb b/app/models/concerns/searchable.rb index 82fb742bc..08e00ed71 100644 --- a/app/models/concerns/searchable.rb +++ b/app/models/concerns/searchable.rb @@ -59,9 +59,9 @@ module Searchable private def create_in_search_index - fields_sql = ["rowid", *search_fields].join(", ") - placeholders = (["?"] * (search_fields.size + 1)).join(", ") - values = [id, *search_values] + fields_sql = [ "rowid", *search_fields ].join(", ") + placeholders = ([ "?" ] * (search_fields.size + 1)).join(", ") + values = [ id, *search_values ] execute_sql_with_binds( "insert into #{search_table}(#{fields_sql}) values (#{placeholders})", @@ -72,7 +72,7 @@ module Searchable def update_in_search_index transaction do set_clause = search_fields.map { |field| "#{field} = ?" }.join(", ") - binds = search_values + [id] + binds = search_values + [ id ] updated = execute_sql_with_binds( "update #{search_table} set #{set_clause} where rowid = ?", diff --git a/db/migrate/20250624055720_add_description_to_cards_search_index.rb b/db/migrate/20250624055720_add_description_to_cards_search_index.rb index 2f58e6c02..a2b22b9cc 100644 --- a/db/migrate/20250624055720_add_description_to_cards_search_index.rb +++ b/db/migrate/20250624055720_add_description_to_cards_search_index.rb @@ -1,6 +1,6 @@ class AddDescriptionToCardsSearchIndex < ActiveRecord::Migration[8.1] def change - drop_virtual_table :cards_search_index, "fts5", ["title"] - create_virtual_table :cards_search_index, "fts5", ["title", "description"] + drop_virtual_table :cards_search_index, "fts5", [ "title" ] + create_virtual_table :cards_search_index, "fts5", [ "title", "description" ] end end