Patch #42445
closed
Remove extra condition in User#notify_about?
Added by Nishida Yuya about 1 year ago.
Updated about 1 year ago.
Category:
Code cleanup/refactoring
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
- Target version set to 6.1.0
Setting the target version to 6.1.0.
- 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?
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 .
- Status changed from New to Closed
- Target version deleted (
Candidate for next minor release)
Also available in: Atom
PDF