summaryrefslogtreecommitdiffstats
path: root/app/models/issue_relation.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-05 16:14:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-05 16:14:20 +0000
commit5326eb233e3966bb933c7884823e8aac1f94a4c0 (patch)
treed5db54d0cabb642b23e0030246478633eb10c80a /app/models/issue_relation.rb
parentb2ba7db4e1489fca318999214764bac82602fa26 (diff)
downloadredmine-5326eb233e3966bb933c7884823e8aac1f94a4c0.tar.gz
redmine-5326eb233e3966bb933c7884823e8aac1f94a4c0.zip
Overrides IssueRelation#to_s.
git-svn-id: http://svn.redmine.org/redmine/trunk@13563 e93f8b46-1217-0410-a6f0-8f06a7374b81
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