Skip to content

Commit

Permalink
Unify Reminder#unread_notifactions query
Browse files Browse the repository at this point in the history
exists? can be chained to where without having adverse effects

See: https://docs.rubocop.org/rubocop-rails/cops_rails.html#railswhereexists
  • Loading branch information
akabiru committed Nov 28, 2024
1 parent dca1fa3 commit 64cecd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/reminder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Reminder < ApplicationRecord
has_many :notifications, through: :reminder_notifications

def unread_notifications?
notifications.exists?(read_ian: [false, nil])
unread_notifications.exists?
end

def unread_notifications
Expand Down

0 comments on commit 64cecd3

Please sign in to comment.