diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-01-03 13:39:04 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-01-03 13:39:04 +0000 |
commit | 503933c585885adaf5c73957d033eb595b13beca (patch) | |
tree | 0ac98868346c49c352d7de1791949af9612014a0 | |
parent | e4f0b9a9f92e64ba16a671b09311b7a9e9114333 (diff) | |
download | redmine-503933c585885adaf5c73957d033eb595b13beca.tar.gz redmine-503933c585885adaf5c73957d033eb595b13beca.zip |
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
-rw-r--r-- | app/helpers/issues_helper.rb | 3 |
1 files changed, 3 insertions, 0 deletions
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) |