删除attachment关联的attachment_histories

This commit is contained in:
sylor_huang@126.com 2020-04-24 15:52:32 +08:00
parent 0532907f20
commit 21b279d551
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ class Attachment < ApplicationRecord
belongs_to :author, class_name: "User", foreign_key: :author_id
# belongs_to :course, foreign_key: :container_id, optional: true
# has_many :attachment_group_settings, :dependent => :destroy
has_many :attachment_histories, -> { order(version: :desc) }, :dependent => :destroy
# has_many :attachment_histories, -> { order(version: :desc) }, :dependent => :destroy
# 二级目录
# belongs_to :course_second_category, optional: true