Commit 0bc0f05e authored by Heinrich Lee Yu's avatar Heinrich Lee Yu Committed by Douglas Barbosa Alexandre

Fixed use of where.not with multiple fields

The behavior of this is going to change in Rails 6.1
where.not(a: 1, b: 2) is going to be:

WHERE (a != 1 OR b !=2 ) instead of WHERE (a != 1 AND b != 2)
parent 75ac1f73
......@@ -21,7 +21,10 @@ class NotificationSetting < ApplicationRecord
# pending delete).
#
scope :for_projects, -> do
includes(:project).references(:projects).where(source_type: 'Project').where.not(projects: { id: nil, pending_delete: true })
includes(:project).references(:projects)
.where(source_type: 'Project')
.where.not(projects: { id: nil })
.where.not(projects: { pending_delete: true })
end
EMAIL_EVENTS = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment