Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
331d98c2
Commit
331d98c2
authored
Aug 10, 2010
by
Tim Felgentreff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix first version for wiki
parent
08a013da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
5 deletions
+2
-5
wiki_controller.rb
app/controllers/wiki_controller.rb
+1
-0
wiki_content.rb
app/models/wiki_content.rb
+1
-5
No files found.
app/controllers/wiki_controller.rb
View file @
331d98c2
...
...
@@ -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
...
...
app/models/wiki_content.rb
View file @
331d98c2
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment