From 503933c585885adaf5c73957d033eb595b13beca 2013-01-03 13:39:04 From: Jean-Philippe Lang Date: 2013-01-03 13:39:04 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 --- diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index deb0012..11065ec 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)