migration: how to set default datefield

I appologize to the redundancy, since I’m sure this has been answered before.

How do I set a date/datetime field to default to the current day? This is what I’ve tried.

create_table ‘sometable’ |t| do t.column :entered_on, :date, :default => today end

Do you wan to do it for all records in the DB at the time of the migration, or each new record as it is added.

Rails will do the latter for you

http://wiki.rubyonrails.org/rails/pages/MagicFieldNames

Brad http://www.pcast.com

Larry Kelly wrote: