get_page_and_revision handles the case of no rev parameter explicitly, rather than by chance
This commit is contained in:
parent
453968a08b
commit
8323b12795
1 changed files with 5 additions and 1 deletions
|
@ -339,7 +339,11 @@ class WikiController < ApplicationController
|
|||
end
|
||||
|
||||
def get_page_and_revision
|
||||
if @params['rev']
|
||||
@revision_number = @params['rev'].to_i
|
||||
else
|
||||
@revision_number = @page.revisions.length
|
||||
end
|
||||
@revision = @page.revisions[@revision_number - 1]
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue