Commit 331d98c2 authored by Tim Felgentreff's avatar Tim Felgentreff

fix first version for wiki

parent 08a013da
......@@ -84,6 +84,7 @@ class WikiController < ApplicationController
end
#@content.text = params[:content][:text]
#@content.comments = params[:content][:comments]
@content.init_journal(User.current, params[:content][:comments])
@content.attributes = params[:content]
@content.author = User.current
# if page is new @page.save will also save content, but not if page isn't a new record
......
......@@ -57,15 +57,11 @@ class WikiContent < ActiveRecord::Base
WikiContentJournal.class_eval do
attr_protected :data
after_save :compress_version_text
after_save :move_comments_to_notes
# Wiki Content might be large and the data should possibly be compressed
def compress_version_text
self.text = changes["text"].last if changes["text"]
end
def move_comments_to_notes
self.notes = changes.delete("comments").last if changes["comments"]
self.text ||= self.versioned.text
end
def text=(plain)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment