rename deleted_at to archived_at

This commit is contained in:
Pete Matsyburka
2023-12-30 00:37:03 +02:00
parent cfb1bdcd52
commit 6d7d8ae87c
24 changed files with 71 additions and 65 deletions
+3 -3
View File
@@ -5,10 +5,10 @@
# Table name: users
#
# id :bigint not null, primary key
# archived_at :datetime
# consumed_timestep :integer
# current_sign_in_at :datetime
# current_sign_in_ip :string
# deleted_at :datetime
# email :string not null
# encrypted_password :string not null
# failed_attempts :integer default(0), not null
@@ -62,7 +62,7 @@ class User < ApplicationRecord
attribute :role, :string, default: ADMIN_ROLE
attribute :uuid, :string, default: -> { SecureRandom.uuid }
scope :active, -> { where(deleted_at: nil) }
scope :active, -> { where(archived_at: nil) }
scope :admins, -> { where(role: ADMIN_ROLE) }
def access_token
@@ -70,7 +70,7 @@ class User < ApplicationRecord
end
def active_for_authentication?
!deleted_at?
!archived_at?
end
def remember_me