fix(captain): avoid FAQ migration and callback conflicts
This commit is contained in:
+1
-1
@@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user