fix(captain): avoid FAQ migration and callback conflicts

This commit is contained in:
aakashb95
2026-07-13 18:44:24 +05:30
parent cb5b4a539c
commit c3635128ef
3 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2026_07_10_000000) do
ActiveRecord::Schema[7.1].define(version: 2026_07_13_184351) do
# These extensions should be enabled to support this database
enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
@@ -30,7 +30,7 @@ class Captain::FaqSuggestion < ApplicationRecord
validates :question, :answer, :language, presence: true
before_validation :ensure_account
after_commit :update_embedding
after_commit :update_embedding, on: [:create, :update]
scope :ordered, -> { order(source_count: :desc, updated_at: :desc) }
scope :by_language, ->(language) { where(language: language) }