]> source.dussan.org Git - redmine.git/commitdiff
Use IssueRelation#to_s.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 5 Nov 2014 16:33:45 +0000 (16:33 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 5 Nov 2014 16:33:45 +0000 (16:33 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13565 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/queries_helper.rb
app/models/issue_relation.rb

index 583d1b104325d0118b323388733cfadb30df5979..1eb0fa593130b9d2ae823ee5114b6f2ae411123b 100644 (file)
@@ -104,9 +104,8 @@ module QueriesHelper
     when :done_ratio
       progress_bar(value, :width => '80px')
     when :relations
-      other = value.other_issue(issue)
       content_tag('span',
-        (l(value.label_for(issue)) + " " + link_to_issue(other, :subject => false, :tracker => false)).html_safe,
+        value.to_s(issue) {|other| link_to_issue(other, :subject => false, :tracker => false)}.html_safe,
         :class => value.css_classes_for(issue))
     else
       format_object(value)
@@ -128,8 +127,7 @@ module QueriesHelper
       when 'Float'
         sprintf("%.2f", value).gsub('.', l(:general_csv_decimal_separator))
       when 'IssueRelation'
-        other = value.other_issue(object)
-        l(value.label_for(object)) + " ##{other.id}"
+        value.to_s(object)
       when 'Issue'
         if object.is_a?(TimeEntry)
           "#{value.tracker} ##{value.id}: #{value.subject}"
index 9eebe1bb099d0bdd8c6f851ded72cf8cd3b3bc14..f0376b50516c9c05c49f3a3550e207a9a239914d 100644 (file)
@@ -26,7 +26,7 @@ class IssueRelation < ActiveRecord::Base
     end
 
     def to_s(*args)
-      map {|relation| "#{l(relation.label_for(@issue))} ##{relation.other_issue(@issue).id}"}.join(', ')
+      map {|relation| relation.to_s(@issue)}.join(', ')
     end
   end