diff options
author | Nick Schonning <nschonni@gmail.com> | 2023-02-20 13:20:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 03:20:56 +0900 |
commit | 9909b4b653d2f1cef662211a4b8e0b02cbb42fc1 (patch) | |
tree | c091455f619ef56ae4fc44100fd0dfb4890f6d76 /app/models/announcement.rb | |
parent | d3b4d4d4f3ccee19f272c66e7c9acd803661e65b (diff) |
Autofix Rubocop Rails/WhereEquals (#23759)
Diffstat (limited to 'app/models/announcement.rb')
-rw-r--r-- | app/models/announcement.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/announcement.rb b/app/models/announcement.rb index 898bf3efa..339f5ae70 100644 --- a/app/models/announcement.rb +++ b/app/models/announcement.rb @@ -20,7 +20,7 @@ class Announcement < ApplicationRecord scope :unpublished, -> { where(published: false) } scope :published, -> { where(published: true) } - scope :without_muted, ->(account) { joins("LEFT OUTER JOIN announcement_mutes ON announcement_mutes.announcement_id = announcements.id AND announcement_mutes.account_id = #{account.id}").where('announcement_mutes.id IS NULL') } + scope :without_muted, ->(account) { joins("LEFT OUTER JOIN announcement_mutes ON announcement_mutes.announcement_id = announcements.id AND announcement_mutes.account_id = #{account.id}").where(announcement_mutes: { id: nil }) } scope :chronological, -> { order(Arel.sql('COALESCE(announcements.starts_at, announcements.scheduled_at, announcements.published_at, announcements.created_at) ASC')) } scope :reverse_chronological, -> { order(Arel.sql('COALESCE(announcements.starts_at, announcements.scheduled_at, announcements.published_at, announcements.created_at) DESC')) } |