add archived at to accounts

This commit is contained in:
Pete Matsyburka
2024-04-28 10:27:44 +03:00
parent 1b2dec4c2a
commit bb613059de
6 changed files with 36 additions and 20 deletions
+10 -7
View File
@@ -4,13 +4,14 @@
#
# Table name: accounts
#
# id :bigint not null, primary key
# locale :string not null
# name :string not null
# timezone :string not null
# uuid :string not null
# created_at :datetime not null
# updated_at :datetime not null
# id :bigint not null, primary key
# archived_at :datetime
# locale :string not null
# name :string not null
# timezone :string not null
# uuid :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
@@ -49,6 +50,8 @@ class Account < ApplicationRecord
attribute :timezone, :string, default: 'UTC'
attribute :locale, :string, default: 'en-US'
scope :active, -> { where(archived_at: nil) }
def testing?
linked_account_account&.testing?
end
+1 -1
View File
@@ -73,7 +73,7 @@ class User < ApplicationRecord
end
def active_for_authentication?
super && !archived_at?
super && !archived_at? && !account.archived_at?
end
def remember_me