Store wiki references found during rendering
This commit is contained in:
parent
bfecd09b56
commit
cd68db01d2
5 changed files with 61 additions and 63 deletions
|
@ -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]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue