/wiki_page_versions/diff: automatically fix comparison order.

Automatically fix it so that we always compare the newer version with
the wiki version, regardless of the order the pages are given in.
This commit is contained in:
evazion
2020-01-12 15:28:07 -06:00
parent 8dc69bef4b
commit 95dd28fc52

View File

@@ -20,5 +20,11 @@ class WikiPageVersionsController < ApplicationController
@thispage = WikiPageVersion.find(params[:thispage])
@otherpage = WikiPageVersion.find(params[:otherpage])
if @thispage.id < @otherpage.id
@thispage, @otherpage = @otherpage, @thispage
end
respond_with([@thispage, @otherpage])
end
end