This should be an easy one, but I've googled a fair bit.
I am trying to create a database log for my rails app. The log is a postgres table which has a timestamp field, which I have given a DEFAULT of current_timestamp. This works perfectly in raw SQL, if I leave the timestamp field out of my INSERT query, it gets the current timestamp correctly.
In rails I have;
entry = LogTable.new :fieldA => 'valA', :fieldB => 'valB'
entry.save
(LogTable extends ActiveRecord::Base)
Which results in an INSERT query that contains all fields, including the timestamp field set to NULL, which is not allowed by the database so it errors.
I have tried setting :timestamp => 'current_timestamp' and :timestamp => 'DEFAULT' but all end up trying to set it to NULL.