Make User::email required

It shouldn't be required, but it's necessary for Carbon::Emailable.
This commit is contained in:
Les De Ridder 2020-03-07 20:01:11 +01:00
parent aab65e17b3
commit b2ede45d82
3 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ class CreateUsers::V00000000000001 < Avram::Migrator::Migration::V1
add name : String, unique: true
add encrypted_password : String # NOTE: Should really be called 'password_hash'
add email : String?, unique: true
add email : String, unique: true # NOTE: Should be nilable, but Carbon::Emailable doesn't really support it
add created_at : Time
end
end

View File

@ -3,6 +3,6 @@ class Role < BaseModel
column name : String
column description : String?
has_many users : User, foreign_key: :primary_role_id #####
has_many users : User, foreign_key: :primary_role_id
end
end

View File

@ -5,7 +5,7 @@ class User < BaseModel
table do
column name : String
column encrypted_password : String
column email : String?
column email : String
column created_at : Time
belongs_to primary_role : Role