I tried looking for an answer but they were all using User.new etc and not create.
When using User.create() in console with valid attributes I'm getting a User created with nil for ID and nil for the timestamps.
Here is my user Model.
 class User < ApplicationRecord
  attr_writer :name, :email
  before_save {self.email = email.downcase}
  validates :username, presence:true,
                       length: {maximum: 30},
                       uniqueness:true
  VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i
  validates :email, presence:true,
                    length: {maximum:200},
                    format: {with: VALID_EMAIL_REGEX},
                    uniqueness: {case_sensitive: false}
  has_secure_password
  validates :password, presence: true,
                       length: {minimum:6}
end
In the rails console I'm using
User.create(username:"oiuedhioj", email:"damhan@dagr.com",password:"test",password_confirmation:"test")
And getting back
<User id: nil, username: "Damhan", email: nil, created_at: nil, updated_at: nil, password_digest: "$2a$10$oGtRgcHigaHh/UCVX4QdM.AOgyGur8Oud5MyKZheUcQ..."> 
 
     
     
     
    