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
bf14f352
Commit
bf14f352
authored
Jul 25, 2011
by
Gregor Schmidt
Committed by
Holger Just
Jul 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#537] version of new WikiContents should be 0
parent
a35d61bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
wiki_content.rb
app/models/wiki_content.rb
+1
-6
wiki_content_test.rb
test/unit/wiki_content_test.rb
+7
-0
No files found.
app/models/wiki_content.rb
View file @
bf14f352
...
...
@@ -59,12 +59,7 @@ class WikiContent < ActiveRecord::Base
end
def
version
unless
last_journal
# FIXME: This is code that caters for a case that should never happen in the normal code paths!!
create_journal
last_journal
.
update_attribute
(
:created_at
,
updated_on
)
end
last_journal
.
version
new_record?
?
0
:
last_journal
.
version
end
private
...
...
test/unit/wiki_content_test.rb
View file @
bf14f352
...
...
@@ -80,4 +80,11 @@ class WikiContentTest < ActiveSupport::TestCase
page
.
reload
assert_equal
500
.
kilobyte
,
page
.
content
.
text
.
size
end
test
"new WikiContent is version 0"
do
page
=
WikiPage
.
new
(
:wiki
=>
@wiki
,
:title
=>
"Page"
)
page
.
content
=
WikiContent
.
new
(
:text
=>
"Content text"
,
:author
=>
User
.
find
(
1
),
:comments
=>
"My comment"
)
assert_equal
0
,
page
.
content
.
version
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