]> source.dussan.org Git - redmine.git/commitdiff
Fix RuboCop offense Style/YodaCondition (#36919).
authorGo MAEDA <maeda@farend.jp>
Tue, 14 Feb 2023 23:38:26 +0000 (23:38 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 14 Feb 2023 23:38:26 +0000 (23:38 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@22106 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue_relation.rb

index 639c88e5e0f3c967c1f94e0af61d459c2c94411a..f33b755688a3f382aa1da7336ffae5262185e81d 100644 (file)
@@ -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