From 032a24328763c58e1041c5a64db01f2c43a01b89 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 17 Jul 2019 19:36:28 +0800 Subject: [PATCH] fix --- app/models/library.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/library.rb b/app/models/library.rb index 90b9737e..6029f984 100644 --- a/app/models/library.rb +++ b/app/models/library.rb @@ -2,7 +2,7 @@ class Library < ActiveRecord::Base include AASM belongs_to :user - belongs_to :cover, class_name: 'Attachment', foreign_key: :cover_id, optional: true + belongs_to :cover, class_name: 'Attachment', foreign_key: :cover_id has_many :library_applies, dependent: :delete_all has_many :attachments, as: :container