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:
> 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
>
> --
> Best Regards,
> -Larry
> "Work, work, work...there is no satisfactory alternative."
> --- E.Taft Benson
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---