- @next = Note.find(:first, :order => "id ASC", :conditions => [ "status != 'hidden' AND id > :id", { :id => @note.id }] )
- @prev = Note.find(:first, :order => "id DESC", :conditions => [ "status != 'hidden' AND id < :id", { :id => @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