I have a situation where I am encountering a fragmented edi transaction.
What results is that I attempt to INSERT a row for which I am missing
some data. The columns affected all have sensible DEFAULT values but
most also have a NOT NULL constraint.
My problem is that notwithstanding I am not initializing those columns
in my program, ActiveRecord is nonetheless setting them to NULL for the
generated INSERT statement. I can see that this is the case because I
initialize from a hash and the hash contents displayed immediately
before the failing INSERT does not contain the attribute that is causing
the exception. Because that column is explicitly set to NULL in the
INSERT statement its DEFAULT value is not used and the NOT NULL
constraint is triggered.
Now, it is possible that I am misinterpreting what I am seeing. My
question is: Does ActiveRecord, or some other part of the RoR DBMS
interface, actually explicitly set missing attributes to NULL on INSERT
rather than simply ignoring them?