This commit is contained in:
Tom Hughes 2013-09-30 08:35:34 +01:00
parent 554a7c9d47
commit 536d80c2b2

View file

@ -82,7 +82,7 @@ class BrowseController < ApplicationController
@note = Note.find(params[:id])
@title = "#{I18n.t('browse.note.title')} | #{@note.id}"
@next = Note.where("status != 'hidden' AND id > ?", @note.id).order(:id).first
@prev = Note.where("status != 'hidden' AND id < ?", @note.id).order(:id => @desc).first
@prev = Note.where("status != 'hidden' AND id < ?", @note.id).order(:id => :desc).first
rescue ActiveRecord::RecordNotFound
render :action => "not_found", :status => :not_found
end