To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / vendor / plugins / redmine_bibliography / app / models / publication.rb @ 393:9595ab4cac6b

History | View | Annotate | Download (594 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 393:9595ab4cac6b luis
  has_one :bibtex_entry
7 376:ad71d0604ac2 luis
8
  validates_presence_of :title
9 385:a6f8c0584a92 luis
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 390:5562a95edbf7 luis
20
  def next_step
21 391:fecd4b2f4b77 luis
    self.current_step = steps[steps.index(current_step)+1]
22 390:5562a95edbf7 luis
  end
23 385:a6f8c0584a92 luis
24 390:5562a95edbf7 luis
  def previous_step
25 391:fecd4b2f4b77 luis
    self.current_step = steps[steps.index(current_step)-1]
26 390:5562a95edbf7 luis
  end
27
28
  def first_step?
29
    current_step == steps.first
30
  end
31 376:ad71d0604ac2 luis
32 328:aed18b463206 luis
end