I'm trying to add some extra information to my Devise User model like first_name, last_name, age, gender and city.
When I fill the signup form and click to submit I get this error:
SQLite3::ConstraintException: NOT NULL constraint failed: users.first_name: INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?)
def each
loop do
val = step
break self if done?
yield val
end
And these are the parameters if they are any use:
Parameters:
{"utf8"=>"✓", "authenticity_token"=>"2e5oUwMw84HtwSuI09X1O5kjPLYk7SW4VKgGOOxcB93W7sSQYjPgq3N/BGo0+oAEifhec4lQ3PUt9vub17vs7g==", "user"=> {"first_name"=>"Test", "last_name"=>"Test", "age"=>"69", "city"=>"New York", "gender"=>"Trans", "email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
Here is my schema.rb just in case:
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.string "first_name", null: false
t.string "last_name", null: false
t.integer "age", null: false
t.string "city", null: false
t.string "gender", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
Here is my user.rb model too:
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
end