From 503933c585885adaf5c73957d033eb595b13beca Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 3 Jan 2013 13:39:04 +0000 Subject: [PATCH] Don't do any query if id is not present. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11105 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/issues_helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index deb001273..11065ecc2 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -347,6 +347,9 @@ module IssuesHelper # Find the name of an associated record stored in the field attribute def find_name_by_reflection(field, id) + unless id.present? + return nil + end association = Issue.reflect_on_association(field.to_sym) if association record = association.class_name.constantize.find_by_id(id) -- 2.39.5