Save to DB returns false with no error message, how to diagnose it?

Hi. Working along a tutorial, I am trying to create a user for my
application, and save it to a User database table. However, when I try
save the user (i.e. add a line to the User table) the Ruby console just
returns false, with no explanation. Using *create *instead of *save
the same. I have tried deleting the database and doing the migration
but got the same result. How can I obtain more diagnostic on why the
to database is failing?

Here a transcript from the console:

Loading development environment (Rails 3.2.9)
irb(main):001:0> user= screen_name: “ginopino”, real_name:
Pilotino”, password: “foobar”, password_confirmation: “foobar”
=> #<User id: nil, screen_name: “ginopino”, real_name: “Gino Pilotino”,
created_at: nil, updated_at: nil, password_digest:
←[1m←[36m (0.0ms)←[0m ←[1mbegin transaction←[0m
←[1m←[35m (0.0ms)←[0m rollback transaction
=> false

On Dec 7, 2012, at 8:54 AM, Fanta wrote:

=> false

these commands might be useful in the console…


check log/development.log


Thank you Craig, that resolved it.
user.errors reminded me that I had imposed a constraint on the password
length, and my password did not respect it.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs