Project

General

Profile

Actions

Patch #42445

closed

Remove extra condition in User#notify_about?

Added by Nishida Yuya 12 days ago. Updated 4 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Code cleanup/refactoring
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

In User#notify_about?, the case of mail_notification.blank? is never. Because User#set_mail_notification (before_create) sets Setting.default_notification_option if blank.

So we can remove its condition. This patch removes it.



Files

Actions #1

Updated by Go MAEDA 10 days ago

  • Target version set to 6.1.0

Setting the target version to 6.1.0.

Actions #2

Updated by Go MAEDA 9 days ago

  • Target version changed from 6.1.0 to Candidate for next minor release

Although the users.mail_notification column is set to true when creating a user object, it is possible to set this column to blank by manually executing an SQL statement. Therefore, I believe it would be better to keep the current code as it is.

What is your opinion on this?

Actions #3

Updated by Nishida Yuya 8 days ago

it is possible to set this column to blank by manually executing an SQL statement.

I see. Thanks comment! I understood that I also need to consider the case when SQL is manually executed, so this patch (0001-refactor-remove-extra-condition.patch) and issue are incorrect.

Instead, I found a bug about manual executing SQL. Its details and patch is in #42467 .

Actions #4

Updated by Go MAEDA 4 days ago

  • Status changed from New to Closed
  • Target version deleted (Candidate for next minor release)
Actions

Also available in: Atom PDF