From 257b774c53d21fc14f4ed3315d38bdc3c1ba3580 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 14 Feb 2023 23:38:26 +0000 Subject: [PATCH] Fix RuboCop offense Style/YodaCondition (#36919). git-svn-id: https://svn.redmine.org/redmine/trunk@22106 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue_relation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb index 639c88e5e..f33b75568 100644 --- a/app/models/issue_relation.rb +++ b/app/models/issue_relation.rb @@ -175,7 +175,7 @@ class IssueRelation < ActiveRecord::Base def handle_issue_order reverse_if_needed - if TYPE_PRECEDES == relation_type + if relation_type == TYPE_PRECEDES self.delay ||= 0 else self.delay = nil @@ -191,7 +191,7 @@ class IssueRelation < ActiveRecord::Base end def successor_soonest_start - if (TYPE_PRECEDES == self.relation_type) && delay && issue_from && + if (self.relation_type == TYPE_PRECEDES) && delay && issue_from && (issue_from.start_date || issue_from.due_date) add_working_days((issue_from.due_date || issue_from.start_date), (1 + delay)) end -- 2.39.5