book.rb 318 字节
Newer Older
1
class Book < ActiveRecord::Base
2 3
  has_many :authors

4
  has_many :citations, :foreign_key => 'book1_id'
5
  has_many :references, -> { distinct }, through: :citations, source: :reference_of
6 7

  has_many :subscriptions
8 9 10
  has_many :subscribers, through: :subscriptions
  
  enum status: %i( proposed written published )
11
end