about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-20 13:20:56 -0500
committerGitHub <noreply@github.com>2023-02-21 03:20:56 +0900
commit9909b4b653d2f1cef662211a4b8e0b02cbb42fc1 (patch)
treec091455f619ef56ae4fc44100fd0dfb4890f6d76 /app/models
parentd3b4d4d4f3ccee19f272c66e7c9acd803661e65b (diff)
Autofix Rubocop Rails/WhereEquals (#23759)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/announcement.rb2
-rw-r--r--app/models/status.rb2
2 files changed, 2 insertions, 2 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')) }
 
diff --git a/app/models/status.rb b/app/models/status.rb
index 2eb47d72c..e7ea191a8 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -95,7 +95,7 @@ class Status < ApplicationRecord
   scope :local,  -> { where(local: true).or(where(uri: nil)) }
   scope :with_accounts, ->(ids) { where(id: ids).includes(:account) }
   scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') }
-  scope :without_reblogs, -> { where('statuses.reblog_of_id IS NULL') }
+  scope :without_reblogs, -> { where(statuses: { reblog_of_id: nil }) }
   scope :with_public_visibility, -> { where(visibility: :public) }
   scope :tagged_with, ->(tag_ids) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag_ids }) }
   scope :excluding_silenced_accounts, -> { left_outer_joins(:account).where(accounts: { silenced_at: nil }) }