##// END OF EJS Templates
Don't do any query if id is not present....
Jean-Philippe Lang -
r10875:503933c58588
parent child
Show More
@@ -347,6 +347,9 module IssuesHelper
347
347
348 # Find the name of an associated record stored in the field attribute
348 # Find the name of an associated record stored in the field attribute
349 def find_name_by_reflection(field, id)
349 def find_name_by_reflection(field, id)
350 unless id.present?
351 return nil
352 end
350 association = Issue.reflect_on_association(field.to_sym)
353 association = Issue.reflect_on_association(field.to_sym)
351 if association
354 if association
352 record = association.class_name.constantize.find_by_id(id)
355 record = association.class_name.constantize.find_by_id(id)
General Comments 0
You need to be logged in to leave comments. Login now