diff options
author | Go MAEDA <maeda@farend.jp> | 2023-06-29 14:42:54 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-06-29 14:42:54 +0000 |
commit | 945a82b5c0aad6bd6af656865015277d3e0e612b (patch) | |
tree | d6bf1c4e7fdf2bb5d32b55ae7e5c0477b31377c9 /app/models/issue_relation.rb | |
parent | ebf3fb3b4fa53f3bc6f9cbbcd529c6b296d4f6fc (diff) | |
download | redmine-945a82b5c0aad6bd6af656865015277d3e0e612b.tar.gz redmine-945a82b5c0aad6bd6af656865015277d3e0e612b.zip |
<=> operator should return nil when invoked with an incomparable object (#38772).
Patch by Go MAEDA.
git-svn-id: https://svn.redmine.org/redmine/trunk@22269 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_relation.rb')
-rw-r--r-- | app/models/issue_relation.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb index f33b75568..2caaca9ba 100644 --- a/app/models/issue_relation.rb +++ b/app/models/issue_relation.rb @@ -198,6 +198,8 @@ class IssueRelation < ActiveRecord::Base end def <=>(relation) + return nil unless relation.is_a?(IssueRelation) + r = TYPES[self.relation_type][:order] <=> TYPES[relation.relation_type][:order] r == 0 ? id <=> relation.id : r end |