To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / test / exemplars / issue_exemplar.rb @ 441:cbce1fd3b1b7
History | View | Annotate | Download (449 Bytes)
| 1 |
class Issue < ActiveRecord::Base |
|---|---|
| 2 |
generator_for :subject, :method => :next_subject |
| 3 |
generator_for :author, :method => :next_author |
| 4 |
generator_for :priority, :method => :fetch_priority |
| 5 |
|
| 6 |
def self.next_subject |
| 7 |
@last_subject ||= 'Subject 0' |
| 8 |
@last_subject.succ!
|
| 9 |
@last_subject
|
| 10 |
end
|
| 11 |
|
| 12 |
def self.next_author |
| 13 |
User.generate_with_protected!
|
| 14 |
end
|
| 15 |
|
| 16 |
def self.fetch_priority |
| 17 |
IssuePriority.first || IssuePriority.generate! |
| 18 |
end
|
| 19 |
|
| 20 |
end
|