summaryrefslogtreecommitdiffstats
path: root/app/models/issue_relation.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/issue_relation.rb')
-rw-r--r--app/models/issue_relation.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb
index 7248a8868..9eebe1bb0 100644
--- a/app/models/issue_relation.rb
+++ b/app/models/issue_relation.rb
@@ -134,6 +134,16 @@ class IssueRelation < ActiveRecord::Base
:unknow
end
+ def to_s(issue=nil)
+ issue ||= issue_from
+ issue_text = block_given? ? yield(other_issue(issue)) : "##{other_issue(issue).try(:id)}"
+ s = []
+ s << l(label_for(issue))
+ s << "(#{l('datetime.distance_in_words.x_days', :count => delay)})" if delay && delay != 0
+ s << issue_text
+ s.join(' ')
+ end
+
def css_classes_for(issue)
"rel-#{relation_type_for(issue)}"
end