From 9044305b9335bb74f607944ffb3d6dd483da8f0b Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 27 Jan 2010 18:29:03 +0000 Subject: Added some exemplars for object daddy to generate test data. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3340 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/exemplars/wiki_page_exemplar.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/exemplars/wiki_page_exemplar.rb (limited to 'test/exemplars/wiki_page_exemplar.rb') diff --git a/test/exemplars/wiki_page_exemplar.rb b/test/exemplars/wiki_page_exemplar.rb new file mode 100644 index 000000000..d70cc2278 --- /dev/null +++ b/test/exemplars/wiki_page_exemplar.rb @@ -0,0 +1,14 @@ +class WikiPage < ActiveRecord::Base + generator_for :title, :method => :next_title + generator_for :wiki, :method => :generate_wiki + + def self.next_title + @last_title ||= 'AWikiPage' + @last_title.succ! + @last_title + end + + def self.generate_wiki + Wiki.generate! + end +end -- cgit v1.2.3