From 334a1c7e6912b61ec9ed31e8e03f5d72e4d563bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sat, 17 Aug 2024 11:35:38 +0800 Subject: [PATCH] Fix index. --- app/models/column_entry.rb | 4 ++-- app/models/table_entry.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/column_entry.rb b/app/models/column_entry.rb index 6631164..44c3845 100644 --- a/app/models/column_entry.rb +++ b/app/models/column_entry.rb @@ -22,8 +22,8 @@ class ColumnEntry belongs_to :table_column, index: true I18n.available_locales.each do |locale| - index({text: 1}, { collation: {locale: locale.to_s}, unique: false, background: true }) - index({content: 1}, { collation: {locale: locale.to_s}, unique: false, background: true }) + index({"text.#{locale}" => 1}, { unique: false, background: true }) + index({"content.#{locale}" => 1}, { unique: false, background: true }) end diff --git a/app/models/table_entry.rb b/app/models/table_entry.rb index f56d4dc..2f23c79 100644 --- a/app/models/table_entry.rb +++ b/app/models/table_entry.rb @@ -14,7 +14,7 @@ class TableEntry accepts_nested_attributes_for :column_entries, :allow_destroy => true I18n.available_locales.each do |locale| - index({have_data: 1}, { collation: {locale: locale.to_s}, unique: false, background: true }) + index({"have_data.#{locale}" => 1}, { unique: false, background: true }) end before_save do