diff --git a/app/models/user.rb b/app/models/user.rb index b08baf7b8..0c3775068 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -72,7 +72,7 @@ class User < ApplicationRecord filtered_records } - scope :unconfirmed, -> { where(confirmed_at: nil) } + scope :unconfirmed, -> { where(confirmed_at: nil, active: true) } scope :deactivated, -> { where(active: false) } scope :active_status, -> { where(active: true).where.not(confirmed_at: nil) } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 021908843..5e73af28a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -294,7 +294,7 @@ RSpec.describe User, type: :model do context "when filtering by status" do before do user_2.update!(active: false) - user_3.update!(active: false) + user_3.update!(active: false, confirmed_at: nil) user_4.update!(confirmed_at: nil) end