diff --git a/CHANGELOG.md b/CHANGELOG.md index 4359044..1cf3300 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Changelog for Custom Workflows ============================== +2.0.1 *2022-05-13* +------------------ + + Ruby 2.7 backward compatibility + +* Bug: #257 - IssueRelation.to_s is broken after #257 bug +* Bug: #258 - Tried to create Proc object without a block + 2.0.0 *2022-04-27* ------------------ diff --git a/README.md b/README.md index 18d9fe3..4f08bec 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Custom Workflows plug-in ======================== -The current version of Redmine CustomWorkflows is **2.0.0** +The current version of Redmine CustomWorkflows is **2.0.1** [![pipeline status](https://gitlab.kontron.com/redmine-plugins/redmine_custom_workflows/badges/master/pipeline.svg)](https://gitlab.kontron.com/redmine-plugins/redmine_custom_workflows/-/commits/master) [![Support Ukraine Badge](https://bit.ly/support-ukraine-now)](https://github.com/support-ukraine/support-ukraine) 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