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

fix first version for wiki

parent 08a013da
...@@ -84,6 +84,7 @@ class WikiController < ApplicationController ...@@ -84,6 +84,7 @@ class WikiController < ApplicationController
end end
#@content.text = params[:content][:text] #@content.text = params[:content][:text]
#@content.comments = params[:content][:comments] #@content.comments = params[:content][:comments]
@content.init_journal(User.current, params[:content][:comments])
@content.attributes = params[:content] @content.attributes = params[:content]
@content.author = User.current @content.author = User.current
# if page is new @page.save will also save content, but not if page isn't a new record # 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 ...@@ -57,15 +57,11 @@ class WikiContent < ActiveRecord::Base
WikiContentJournal.class_eval do WikiContentJournal.class_eval do
attr_protected :data attr_protected :data
after_save :compress_version_text after_save :compress_version_text
after_save :move_comments_to_notes
# Wiki Content might be large and the data should possibly be compressed # Wiki Content might be large and the data should possibly be compressed
def compress_version_text def compress_version_text
self.text = changes["text"].last if changes["text"] self.text = changes["text"].last if changes["text"]
end self.text ||= self.versioned.text
def move_comments_to_notes
self.notes = changes.delete("comments").last if changes["comments"]
end end
def text=(plain) 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