From: Go MAEDA Date: Tue, 14 Feb 2023 23:38:26 +0000 (+0000) Subject: Fix RuboCop offense Style/YodaCondition (#36919). X-Git-Tag: 5.1.0~241 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=257b774c53d21fc14f4ed3315d38bdc3c1ba3580;p=redmine.git Fix RuboCop offense Style/YodaCondition (#36919). git-svn-id: https://svn.redmine.org/redmine/trunk@22106 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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