On Aug 5, 2:34pm, Tim U. [email protected] wrote:
Activerecord sets the columns that are not specified to NULL. Postgres
presumes that since your insert statement said to set the column to
null you meant to set it null and ignores the default. Is there a way
to tell activerecord not set missing attributes to null?
I don’t think so - I think activerecord is expecting to be able to
read the default values out of the database schema, although that
assumes that the default is some fixed value.
It should be possible to do something like this though, since updates
only write unchanged columns.