From: Toshi MARUYAMA Date: Tue, 22 Oct 2019 15:54:37 +0000 (+0000) Subject: code cleanup: rubocop: fix Style/ParenthesesAroundCondition in app/models/time_entry.rb X-Git-Tag: 4.1.0~269 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b6604ec7510e295036920ccc30d28c0061f0885c;p=redmine.git code cleanup: rubocop: fix Style/ParenthesesAroundCondition in app/models/time_entry.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18834 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 88a3e2b6a..46fc37d7a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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' diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb index d2661d078..e376e0ffd 100644 --- a/app/models/time_entry.rb +++ b/app/models/time_entry.rb @@ -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