]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Style/ParenthesesAroundCondition in app/models/time_entry.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 22 Oct 2019 15:54:37 +0000 (15:54 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 22 Oct 2019 15:54:37 +0000 (15:54 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18834 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
app/models/time_entry.rb

index 88a3e2b6a474576f408e7218ef734c4503a61f8f..46fc37d7a2393ca6daca2c01b2c7e002f9137d8d 100644 (file)
@@ -1144,7 +1144,6 @@ Style/ParallelAssignment:
 Style/ParenthesesAroundCondition:
   Exclude:
     - 'app/models/repository/subversion.rb'
-    - 'app/models/time_entry.rb'
     - 'app/models/wiki_page.rb'
     - 'lib/diff.rb'
     - 'lib/redmine/helpers/gantt.rb'
index d2661d078eaf118a4ff4b8330d2e8b54573d13d2..e376e0ffd050df495442607738c8ca6c7e2f3425 100644 (file)
@@ -142,11 +142,11 @@ class TimeEntry < ActiveRecord::Base
       end
     end
     errors.add :project_id, :invalid if project.nil?
-    errors.add :user_id, :invalid if (user_id != author_id && !self.assignable_users.map(&:id).include?(user_id))
+    errors.add :user_id, :invalid if user_id != author_id && !self.assignable_users.map(&:id).include?(user_id)
     errors.add :issue_id, :invalid if (issue_id && !issue) || (issue && project!=issue.project) || @invalid_issue_id
     errors.add :activity_id, :inclusion if activity_id_changed? && project && !project.activities.include?(activity)
     if spent_on_changed? && user
-      errors.add :base, I18n.t(:error_spent_on_future_date) if (!Setting.timelog_accept_future_dates? && (spent_on > user.today))
+      errors.add :base, I18n.t(:error_spent_on_future_date) if !Setting.timelog_accept_future_dates? && (spent_on > user.today)
     end
   end