add user model
This commit is contained in:
24
app/models/user.rb
Normal file
24
app/models/user.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: users
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# email :string not null
|
||||
# first_name :string not null
|
||||
# last_name :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_users_on_email (email) UNIQUE
|
||||
#
|
||||
class User < ApplicationRecord
|
||||
validates :first_name, :last_name, :email, presence: true
|
||||
|
||||
def full_name
|
||||
"#{first_name} #{last_name}"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user