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 / test / exemplars / wiki_redirect_exemplar.rb @ 441:cbce1fd3b1b7

History | View | Annotate | Download (471 Bytes)

1
class WikiRedirect < ActiveRecord::Base
2
  generator_for :title, :method => :next_title
3
  generator_for :redirects_to, :method => :next_redirects_to
4
  generator_for :wiki, :method => :generate_wiki
5

    
6
  def self.next_title
7
    @last_title ||= 'AWikiPage'
8
    @last_title.succ!
9
    @last_title
10
  end
11

    
12
  def self.next_redirects_to
13
    @last_redirect ||= '/a/path/000001'
14
    @last_redirect.succ!
15
    @last_redirect
16
  end
17

    
18
  def self.generate_wiki
19
    Wiki.generate!
20
  end
21
end