From 7014008246fd604ab3647353bd315e1f8351f63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Fri, 13 May 2022 08:07:10 +0200 Subject: [PATCH] IssueRelation.to_s is broken #258 --- .../patches/issue_relation_patch.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/redmine_custom_workflows/patches/issue_relation_patch.rb b/lib/redmine_custom_workflows/patches/issue_relation_patch.rb index 1e67623..ecde0e2 100644 --- a/lib/redmine_custom_workflows/patches/issue_relation_patch.rb +++ b/lib/redmine_custom_workflows/patches/issue_relation_patch.rb @@ -36,7 +36,15 @@ module RedmineCustomWorkflows alias_method :old_to_s, :to_s def to_s(issue=nil) - block_given? ? old_to_s(issue, &Proc.new {}) : old_to_s(issue) + if block_given? + if Gem.ruby_version < Gem::Version.new('3.0') + old_to_s issue, &Proc.new + else + old_to_s issue, &Proc.new {} + end + else + old_to_s issue + end rescue NoMethodError => e if issue_from.present? || issue_to.present? raise e