luis@385: # vendor/plugins/redmine_bibliography/app/models/publication.rb luis@385: luis@328: class Publication < ActiveRecord::Base luis@428: unloadable luis@445: luis@468: has_many :authorships, :dependent => :destroy luis@447: has_many :authors, :through => :authorships, :uniq => true luis@446: luis@445: has_one :bibtex_entry, :dependent => :destroy luis@376: luis@376: validates_presence_of :title luis@445: luis@445: accepts_nested_attributes_for :authorships luis@446: accepts_nested_attributes_for :authors, :allow_destroy => true luis@454: accepts_nested_attributes_for :bibtex_entry, :allow_destroy => true luis@454: luis@464: has_and_belongs_to_many :projects, :uniq => true luis@428: luis@328: end