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