Colin Law wrote in post #963375:
Please remember to quote the previous message so one can follow the
I think you're right...it's probably somewhere in the save code.
Problem is, the save method is buried in the Devise (gem) code, so have
to figure out what's going on there :/. I've verified before and after
the save method, the value is 1; however, the value in the raw sql
insert query into the database is 0.
Are you sure the attribute name exactly matches the column name -
check for typo.
Check that mass write is not prevented (as Marnen suggested) by
creating, setting and saving a record in the console.
I got it figured out... I had an attr_accessor set for the
:receive_offers field, AND the column existed on the table. As such,
when the AR object was populated (from the form hash), it was setting
the attribute from attr_accessor, rather than the one from the database.
Not a very clear explanation, but removing the unnecessary attr_accessor
was the culprit.
Thanks for your help