feat: Add admin user creation support and fix user entity
This commit is contained in:
@@ -7,6 +7,7 @@ module EuchreCamp
|
||||
attribute :player_id, Types::Integer
|
||||
attribute :email, Types::String
|
||||
attribute :password_digest, Types::String
|
||||
attribute :role, Types::String, default: 'player'
|
||||
attribute :confirmed, Types::Bool
|
||||
attribute? :confirmation_token, Types::String.optional
|
||||
attribute? :confirmation_sent_at, Types::Time.optional
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module EuchreCamp
|
||||
module Persistence
|
||||
module Relations
|
||||
class Users < ROM::Relation[:sql]
|
||||
schema(:users, infer: true) do
|
||||
attribute :id, ROM::Types::Integer, primary_key: true
|
||||
attribute :player_id, ROM::Types::Integer
|
||||
attribute :email, ROM::Types::String
|
||||
attribute :password_digest, ROM::Types::String
|
||||
attribute :role, ROM::Types::String
|
||||
attribute :confirmed, ROM::Types::Bool
|
||||
attribute :confirmation_token, ROM::Types::String.optional
|
||||
attribute :confirmation_sent_at, ROM::Types::Time.optional
|
||||
attribute :reset_password_token, ROM::Types::String.optional
|
||||
attribute :reset_password_sent_at, ROM::Types::Time.optional
|
||||
attribute :failed_login_attempts, ROM::Types::Integer
|
||||
attribute :locked_until, ROM::Types::Time.optional
|
||||
attribute :last_login_at, ROM::Types::Time.optional
|
||||
attribute :last_login_ip, ROM::Types::String.optional
|
||||
attribute :created_at, ROM::Types::Time
|
||||
attribute :updated_at, ROM::Types::Time
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user