get_page_and_revision handles the case of no rev parameter explicitly, rather than by chance

This commit is contained in:
Alexey Verkhovsky 2006-09-19 19:13:02 +00:00
parent 453968a08b
commit 8323b12795

View file

@ -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