Fix model dependencies.

This commit is contained in:
邱博亞 2024-07-20 08:45:45 +08:00
parent 659ab43e94
commit 2d00288a4c
3 changed files with 4 additions and 4 deletions

View File

@ -11,8 +11,8 @@ class ColumnEntry
mount_uploader :image, ImageUploader mount_uploader :image, ImageUploader
belongs_to :table_entry, :dependent => :destroy, index: true belongs_to :table_entry, index: true
belongs_to :table_column, :dependent => :destroy, index: true belongs_to :table_column, index: true
I18n.available_locales.each do |locale| I18n.available_locales.each do |locale|
index({text: 1}, { collation: {locale: locale.to_s}, unique: false, background: true }) index({text: 1}, { collation: {locale: locale.to_s}, unique: false, background: true })

View File

@ -12,7 +12,7 @@ class TableColumn
field :make_categorizable, type: Boolean, default: false field :make_categorizable, type: Boolean, default: false
field :default_ordered_field, type: Boolean, default: false field :default_ordered_field, type: Boolean, default: false
field :order_direction,type: String,default: 'desc' field :order_direction,type: String,default: 'desc'
belongs_to :u_table, :dependent => :destroy, index: true belongs_to :u_table, index: true
has_many :column_entries has_many :column_entries

View File

@ -7,7 +7,7 @@ class TableEntry
field :sort_number, type: Integer field :sort_number, type: Integer
has_many :column_entries, :dependent => :destroy has_many :column_entries, :dependent => :destroy
belongs_to :u_table, :dependent => :destroy, index: true belongs_to :u_table, index: true
accepts_nested_attributes_for :column_entries, :allow_destroy => true accepts_nested_attributes_for :column_entries, :allow_destroy => true