Store wiki references found during rendering

This commit is contained in:
Alexey Verkhovsky 2005-09-11 05:44:34 +00:00
parent bfecd09b56
commit cd68db01d2
5 changed files with 61 additions and 63 deletions

View file

@ -6,7 +6,7 @@ require 'zip/zip'
class WikiController < ApplicationController
# TODO implement cache sweeping
caches_page :show
caches_page :show, :published
layout 'default', :except => [:rss_feed, :rss_with_content, :rss_with_headlines, :tex, :export_tex, :export_html]

View file

@ -1,6 +1,7 @@
class Page < ActiveRecord::Base
belongs_to :web
has_many :revisions, :order => 'id'
has_many :wiki_references, :order => 'referenced_page_name'
has_one :current_revision, :class_name => 'Revision', :order => 'id DESC'
def revise(content, time, author, renderer)
@ -15,7 +16,7 @@ class Page < ActiveRecord::Base
# Try to render content to make sure that markup engine can take it,
renderer.revision = Revision.new(
:page => self, :content => content, :author => author, :revised_at => time)
renderer.force_rendering
renderer.display_content
# A user may change a page, look at it and make some more changes - several times.
# Not to record every such iteration as a new revision, if the previous revision was done