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 @ 403:b15397a5341c
History | View | Annotate | Download (594 Bytes)
| 1 |
# vendor/plugins/redmine_bibliography/app/models/publication.rb
|
|---|---|
| 2 |
|
| 3 |
class Publication < ActiveRecord::Base |
| 4 |
has_many :authorships
|
| 5 |
has_many :authors, :through => :authorships |
| 6 |
has_one :bibtex_entry
|
| 7 |
|
| 8 |
validates_presence_of :title
|
| 9 |
|
| 10 |
attr_writer :current_step
|
| 11 |
|
| 12 |
def current_step |
| 13 |
@current_step || steps.first
|
| 14 |
end
|
| 15 |
|
| 16 |
def steps |
| 17 |
%w[new review]
|
| 18 |
end
|
| 19 |
|
| 20 |
def next_step |
| 21 |
self.current_step = steps[steps.index(current_step)+1] |
| 22 |
end
|
| 23 |
|
| 24 |
def previous_step |
| 25 |
self.current_step = steps[steps.index(current_step)-1] |
| 26 |
end
|
| 27 |
|
| 28 |
def first_step? |
| 29 |
current_step == steps.first |
| 30 |
end
|
| 31 |
|
| 32 |
end
|