Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 1c8ccbd

Browse files
authored
FIX: simplify provider_params json conversion
1 parent 4dbfce2 commit 1c8ccbd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

db/migrate/20250110114305_embedding_config_data_migration.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ def model_attrs(model_name)
171171
end
172172

173173
def persist_config(attrs)
174-
provider_params_json = attrs[:provider_params].to_json if attrs[:provider_params].present?
175-
176174
DB.exec(
177175
<<~SQL,
178176
INSERT INTO embedding_definitions (id, display_name, dimensions, max_sequence_length, version, pg_function, provider, tokenizer_class, url, api_key, provider_params, seeded, created_at, updated_at)
@@ -187,7 +185,7 @@ def persist_config(attrs)
187185
tokenizer_class: attrs[:tokenizer_class],
188186
url: attrs[:url],
189187
api_key: attrs[:api_key],
190-
provider_params: provider_params_json,
188+
provider_params: attrs[:provider_params]&.to_json,
191189
seeded: !!attrs[:seeded],
192190
now: Time.zone.now,
193191
)

0 commit comments

Comments
 (0)