1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 19:47:14 +00:00

Fix RuboCop offense Lint/SafeNavigationConsistency (#39887).

git-svn-id: https://svn.redmine.org/redmine/trunk@23134 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2024-10-16 23:46:53 +00:00
parent a04ca392dd
commit 09451a1df0
2 changed files with 2 additions and 2 deletions

View File

@ -2071,7 +2071,7 @@ class Issue < ApplicationRecord
def add_auto_watcher
if author&.active? &&
author&.allowed_to?(:add_issue_watchers, project) &&
author.allowed_to?(:add_issue_watchers, project) &&
author.pref.auto_watch_on?('issue_created') &&
self.watcher_user_ids.exclude?(author.id)
self.set_watcher(author, true)

View File

@ -339,7 +339,7 @@ class Journal < ApplicationRecord
def add_watcher
if user&.active? &&
user&.allowed_to?(:add_issue_watchers, project) &&
user.allowed_to?(:add_issue_watchers, project) &&
user.pref.auto_watch_on?('issue_contributed_to') &&
!Watcher.any_watched?(Array.wrap(journalized), user)
journalized.set_watcher(user, true)