Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
bf14f352
Commit
bf14f352
authored
13 years ago
by
Gregor Schmidt
Committed by
Holger Just
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[#537] version of new WikiContents should be 0
parent
a35d61bf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/wiki_content.rb
+1
-6
1 addition, 6 deletions
app/models/wiki_content.rb
test/unit/wiki_content_test.rb
+7
-0
7 additions, 0 deletions
test/unit/wiki_content_test.rb
with
8 additions
and
6 deletions
app/models/wiki_content.rb
+
1
−
6
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
...
...
This diff is collapsed.
Click to expand it.
test/unit/wiki_content_test.rb
+
7
−
0
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
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment