To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / vendor / plugins / redmine_bibliography / app / models / publication.rb @ 391:fecd4b2f4b77
History | View | Annotate | Download (570 Bytes)
| 1 | 385:a6f8c0584a92 | luis | # vendor/plugins/redmine_bibliography/app/models/publication.rb
|
|---|---|---|---|
| 2 | |||
| 3 | 328:aed18b463206 | luis | class Publication < ActiveRecord::Base |
| 4 | has_many :authorships
|
||
| 5 | has_many :authors, :through => :authorships |
||
| 6 | 376:ad71d0604ac2 | luis | |
| 7 | validates_presence_of :title
|
||
| 8 | 385:a6f8c0584a92 | luis | |
| 9 | attr_writer :current_step
|
||
| 10 | |||
| 11 | def current_step |
||
| 12 | @current_step || steps.first
|
||
| 13 | end
|
||
| 14 | |||
| 15 | def steps |
||
| 16 | %w[new review]
|
||
| 17 | end
|
||
| 18 | 390:5562a95edbf7 | luis | |
| 19 | def next_step |
||
| 20 | 391:fecd4b2f4b77 | luis | self.current_step = steps[steps.index(current_step)+1] |
| 21 | 390:5562a95edbf7 | luis | end
|
| 22 | 385:a6f8c0584a92 | luis | |
| 23 | 390:5562a95edbf7 | luis | def previous_step |
| 24 | 391:fecd4b2f4b77 | luis | self.current_step = steps[steps.index(current_step)-1] |
| 25 | 390:5562a95edbf7 | luis | end
|
| 26 | |||
| 27 | def first_step? |
||
| 28 | current_step == steps.first |
||
| 29 | end
|
||
| 30 | 376:ad71d0604ac2 | luis | |
| 31 | 328:aed18b463206 | luis | end |