Revision 445:77f88379115a vendor/plugins/redmine_bibliography/app/models
| vendor/plugins/redmine_bibliography/app/models/author.rb | ||
|---|---|---|
| 2 | 2 |
has_many :authorships |
| 3 | 3 |
has_many :publications, :through => :authorships |
| 4 | 4 |
|
| 5 |
belongs_to :user |
|
| 5 |
# belongs_to :user
|
|
| 6 | 6 |
|
| 7 | 7 |
end |
| vendor/plugins/redmine_bibliography/app/models/publication.rb | ||
|---|---|---|
| 2 | 2 |
|
| 3 | 3 |
class Publication < ActiveRecord::Base |
| 4 | 4 |
unloadable |
| 5 |
|
|
| 6 |
|
|
| 5 |
|
|
| 7 | 6 |
has_many :authorships |
| 8 | 7 |
has_many :authors, :through => :authorships |
| 9 |
has_one :bibtex_entry |
|
| 8 |
has_one :bibtex_entry, :dependent => :destroy
|
|
| 10 | 9 |
|
| 11 | 10 |
validates_presence_of :title |
| 11 |
|
|
| 12 |
accepts_nested_attributes_for :authorships |
|
| 13 |
accepts_nested_attributes_for :authors, :reject_if => lambda { |a| a[:name].blank? }, :allow_destroy => true
|
|
| 14 |
# accepts_nested_attributes_for :bibtex_entry, :reject_if => lambda { |a| a[:name].blank? }, :allow_destroy => true
|
|
| 12 | 15 |
|
| 13 |
accepts_nested_attributes_for :authors, :bibtex_entry |
|
| 16 |
|
|
| 14 | 17 |
|
| 15 | 18 |
attr_writer :current_step |
| 16 | 19 |
|
Also available in: Unified diff