Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gpt
large_projects
gitlabhq1
Commits
58ca7553
Commit
58ca7553
authored
12 years ago
by
Dan Knox
Browse files
Options
Download
Email Patches
Plain Diff
Ensure old revisions are retrieved from the DB in the correct order.
parent
db577200
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
lib/wiki_to_gollum_migrator.rb
lib/wiki_to_gollum_migrator.rb
+1
-1
spec/lib/wiki_to_gollum_migrator_spec.rb
spec/lib/wiki_to_gollum_migrator_spec.rb
+2
-1
No files found.
lib/wiki_to_gollum_migrator.rb
View file @
58ca7553
...
...
@@ -55,7 +55,7 @@ class WikiToGollumMigrator
def
create_page_and_revisions
(
project
,
page
)
# Grab all revisions of the page
revisions
=
project
.
wikis
.
where
(
slug:
page
.
slug
).
order
ed
.
all
revisions
=
project
.
wikis
.
where
(
slug:
page
.
slug
).
order
(
'id desc'
)
.
all
# Remove the first revision created from the array
# and use it to create the Gollum page. Each successive revision
...
...
This diff is collapsed.
Click to expand it.
spec/lib/wiki_to_gollum_migrator_spec.rb
View file @
58ca7553
...
...
@@ -149,7 +149,7 @@ describe WikiToGollumMigrator do
@page
.
user
=
@project
.
owner
@page
.
save!
create_revision
(
@page
)
3
.
times
{
create_revision
(
@page
)
}
subject
.
migrate!
end
...
...
@@ -158,6 +158,7 @@ describe WikiToGollumMigrator do
wiki
=
GollumWiki
.
new
(
@project
,
nil
)
page
=
wiki
.
find_page
(
"2012 06 16"
)
page
.
should
be_present
page
.
content
.
should
==
"Updated Content"
page
.
versions
.
count
.
should
==
2
end
end
...
...
This diff is collapsed.
Click to expand it.
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