Create new user in the database via Rails C

1

Help me where the error is occurring, because I am not able to identify because the field is not being recognized.

  

rails c

u = User.new(email:'[email protected]', registration:192536, password:'changeme', password_confirmation:'changeme')

Look at the error

irb(main):002:0> u.save
   (0.4ms)  BEGIN
  User Exists (1.6ms)  SELECT  1 AS one FROM "users" WHERE "users"."email" = $1 LIMIT $2  [["email", "[email protected]"], ["LIMIT", 1]]
  SQL (1.5ms)  INSERT INTO "users" ("email", "encrypted_password") VALUES ($1, $2) RETURNING "id"  [["email", "[email protected]"], ["encrypted_password", "$2a$11$JieDv.rvWuKi0/34/hooLepn/aKb1a.ZJrlL04m2kJCXFjI3b2JOy"]]
   (0.3ms)  ROLLBACK
ActiveRecord::StatementInvalid: PG::NotNullViolation: ERROR:  null value in column "registration" violates not-null constraint
DETAIL:  Failing row contains (13, [email protected], null, $2a$11$JieDv.rvWuKi0/34/hooLepn/aKb1a.ZJrlL04m2kJCXFjI3b2JOy, null, null, null, 0, null, null, null, null).
: INSERT INTO "users" ("email", "encrypted_password") VALUES ($1, $2) RETURNING "id"

It does not recognize all the parameters I'm passing, does anyone have any idea what it might be?

    
asked by anonymous 06.09.2016 / 21:01

0 answers