With what class type can I assign value to a timestamp field? I tried Time.now and DateTime.now both failed (did nothing).
> With what class type can I assign value to a timestamp field? I > tried Time.now and DateTime.now both failed (did nothing).Timestamps are not supported by default. Use a datetime field instead and assign with Time.now. If you can''t, turn Time.now into seconds before assigning. But you really want a datetime to enjoy maximum pleasure of Rails. (Mmmmm.. pleasssuuure) -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework
On 5/17/05, Gábor SEBESTYÉN <segabor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> With what class type can I assign value to a timestamp field? I tried > Time.now and DateTime.now both failed (did nothing).You shouldn''t be assigning to timestamp columns anyway, a timestamp is there to keep track of ''when the row was last updated''. With rails you get that with updated_at, so switch to DATETIME and enjoy> _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers Koz