Mercurial > hg > soundsoftware-site
annotate vendor/plugins/redmine_bibliography/app/models/publication.rb @ 536:0058debf7871 cannam_integration
Merge from branch "feature_36"
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Tue, 26 Jul 2011 14:08:18 +0100 |
parents | 76d064830472 |
children | ca9e8e562ea7 |
rev | line source |
---|---|
luis@385 | 1 # vendor/plugins/redmine_bibliography/app/models/publication.rb |
luis@385 | 2 |
luis@328 | 3 class Publication < ActiveRecord::Base |
luis@428 | 4 unloadable |
luis@445 | 5 |
luis@468 | 6 has_many :authorships, :dependent => :destroy |
luis@447 | 7 has_many :authors, :through => :authorships, :uniq => true |
luis@446 | 8 |
luis@445 | 9 has_one :bibtex_entry, :dependent => :destroy |
luis@376 | 10 |
luis@376 | 11 validates_presence_of :title |
luis@445 | 12 |
luis@445 | 13 accepts_nested_attributes_for :authorships |
luis@446 | 14 accepts_nested_attributes_for :authors, :allow_destroy => true |
luis@454 | 15 accepts_nested_attributes_for :bibtex_entry, :allow_destroy => true |
luis@454 | 16 |
luis@464 | 17 has_and_belongs_to_many :projects, :uniq => true |
luis@428 | 18 |
luis@328 | 19 end |