From 8ce0205f1553f724f070544d275c7762f480efb3 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Wed, 1 Feb 2012 12:01:21 +0000 Subject: issue #351 redux Corrected diagnosis, test & fix for issue #351. Fixes #351. --- app/controllers/request_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index ccd9636d1..2295d6718 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -716,7 +716,10 @@ class RequestController < ApplicationController @incoming_message.parse_raw_email! @info_request = @incoming_message.info_request if @incoming_message.info_request_id != params[:id].to_i - message = "Incoming message %d does not belong to request %d" % [@incoming_message.info_request_id, params[:id]] + # Note that params[:id] might not be an integer, though + # if we’ve got this far then it must begin with an integer + # and that integer must be the id number of an actual request. + message = "Incoming message %d does not belong to request '%s'" % [@incoming_message.info_request_id, params[:id]] raise ActiveRecord::RecordNotFound.new(message) end @part_number = params[:part].to_i -- cgit v1.2.3