I'm trying to update a record through the rails console and am getting a rollback error:
Project.find(118).update_attributes(:featured=>true)
Project Load (2.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT 1 [["id", 118]]
(2.8ms) BEGIN
(1.3ms) ROLLBACK
=> false
How can I view the source of the error? I'm able to update the attribute for other records, so I'd like to inspect why this particular record isn't working.
Your Project
instance is probably invalid. To see what error prevented it from saving, you can type:
project = Project.find 118
project.assign_attributes(featured: true)
project.valid?
project.errors.full_messages
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With