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
This commit is contained in:
parent
e4f0b9a9f9
commit
503933c585
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue