|
|
@ -2,7 +2,7 @@ class Library < ActiveRecord::Base
|
|
|
|
include AASM
|
|
|
|
include AASM
|
|
|
|
|
|
|
|
|
|
|
|
belongs_to :user
|
|
|
|
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 :library_applies, dependent: :delete_all
|
|
|
|
has_many :attachments, as: :container
|
|
|
|
has_many :attachments, as: :container
|
|
|
|