Refactoring: Agora o sistema se comporta bem com objetos excluidos

This commit is contained in:
2008-03-15 07:44:46 -03:00
parent 8d02e0d4ce
commit 4c55ce7b45
16 changed files with 114 additions and 96 deletions

View File

@@ -100,8 +100,8 @@ class WikiController < ApplicationController
end
def versions
@history_to = params[:to] || @wiki_page.versions.count
@history_from = params[:from] || @wiki_page.versions.count - 1
@history_to = params[:to] || @wiki_page.versions[-1].version
@history_from = params[:from] || (@wiki_page.versions.count > 1 ? @wiki_page.versions[-2].version : @history_to)
@offset = params[:offset] || 0
respond_to do |format|