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
dbc10d27
Commit
dbc10d27
authored
May 19, 2011
by
Felix Schäfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save the comments to wiki page updates correctly. #415
parent
0957e478
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
wiki_content.rb
app/models/wiki_content.rb
+10
-0
20110519194936_remove_comments_from_wiki_content.rb
...grate/20110519194936_remove_comments_from_wiki_content.rb
+9
-0
No files found.
app/models/wiki_content.rb
View file @
dbc10d27
...
...
@@ -23,6 +23,10 @@ class WikiContent < ActiveRecord::Base
validates_presence_of
:text
validates_length_of
:comments
,
:maximum
=>
255
,
:allow_nil
=>
true
attr_accessor
:comments
before_save
:comments_to_journal_notes
acts_as_journalized
:event_type
=>
'wiki-page'
,
:event_title
=>
Proc
.
new
{
|
o
|
"
#{
l
(
:label_wiki_edit
)
}
:
#{
o
.
page
.
title
}
(#
#{
o
.
version
}
)"
},
:event_url
=>
Proc
.
new
{
|
o
|
{
:controller
=>
'wiki'
,
:id
=>
o
.
page
.
wiki
.
project_id
,
:page
=>
o
.
page
.
title
,
:version
=>
o
.
version
}},
...
...
@@ -67,6 +71,12 @@ class WikiContent < ActiveRecord::Base
last_journal
.
version
end
private
def
comments_to_journal_notes
self
.
init_journal
(
author
,
comments
)
end
# FIXME: This is for backwards compatibility only. Remove once we decide it is not needed anymore
WikiContentJournal
.
class_eval
do
attr_protected
:data
...
...
db/migrate/20110519194936_remove_comments_from_wiki_content.rb
0 → 100644
View file @
dbc10d27
class
RemoveCommentsFromWikiContent
<
ActiveRecord
::
Migration
def
self
.
up
remove_column
:wiki_contents
,
:comments
end
def
self
.
down
add_column
:wiki_contents
,
:comments
,
:string
end
end
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