Merge pull request #6810 from artoscinote/ma_SCI_9896

Fix in-app notification scope [SCI-9896][SCI-9874]
This commit is contained in:
Martin Artnik 2023-12-12 15:32:17 +01:00 committed by GitHub
commit b9e14b0706
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -32,7 +32,7 @@ module Reports
subject_class: 'Report',
subject_name: report.name,
report_type: 'docx',
user: @user
user: user
}
)

View file

@ -5,7 +5,9 @@ class Notification < ApplicationRecord
belongs_to :recipient, polymorphic: true
scope :in_app, -> { where.not("notifications.params->'hide_in_app' = 'true'") }
scope :in_app, lambda {
where.not("notifications.params ? 'hide_in_app' AND notifications.params->'hide_in_app' = 'true'")
}
private