From d1ba27358a82778874a7f3deeef6092af151263c Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Tue, 14 Sep 2010 16:59:43 +0200 Subject: [PATCH] fix wiki content specs --- app/models/wiki_content.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb index 39171a45..111d17bd 100644 --- a/app/models/wiki_content.rb +++ b/app/models/wiki_content.rb @@ -53,6 +53,20 @@ class WikiContent < ActiveRecord::Base notified.collect(&:mail) end + # FIXME: Deprecate + def versions + journals + end + + def version + unless last_journal + # FIXME: This is code that caters for a case that should never happen in the normal code paths!! + create_journal + last_journal.update_attribute(:created_at, updated_on) + end + last_journal.version + end + # FIXME: This is for backwards compatibility only. Remove once we decide it is not needed anymore WikiContentJournal.class_eval do attr_protected :data @@ -104,19 +118,5 @@ class WikiContent < ActiveRecord::Base def versioned journaled end - - # FIXME: Deprecate - def versions - journals - end - - def version - unless last_journal - # FIXME: This is code that caters for a case that should never happen in the normal code paths!! - update_journal - last_journal.update_attribute(:created_at, updated_on) - end - last_journal.version - end end end