Browse Source

only show unconfirmed and deactivated logs as deactivated

pull/1797/head
Kat 3 years ago
parent
commit
aaeca98165
  1. 2
      app/models/user.rb
  2. 2
      spec/models/user_spec.rb

2
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) }

2
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

Loading…
Cancel
Save