Hello Again, I have a table with created_on and updated_on columns. Will the updated_on column be left NULL when a new row is initially inserted? If not, is their a way to change this behavior? Also, on documentation.rubyonrails.com I see that I can set ActiveRecord::Base.timestamps_gmt = true to keep all of my timestamps in GMT (something I desire). However, I do not understand _where_ I set this option (in what file). Thanks Again. -- Tabor Kelly tkelly-rails-15BJK4dlZCtAtc6zTKlAYNHuzzzSOjJt@public.gmane.org http://tabor.taborandtashell.net
Tabor Kelly wrote:> I have a table with created_on and updated_on columns. Will the > updated_on column be left NULL when a new row is initially inserted? If > not, is their a way to change this behavior?updated_at will be stamped on creation. I would like it to remain NULL as well. The behavior is not configurable, but you can write your own callbacks to do it. An enhancement request is in order: http://dev.rubyonrails.com/newticket> Also, on documentation.rubyonrails.com I see that I can set > ActiveRecord::Base.timestamps_gmt = true to keep all of my timestamps in > GMT (something I desire). However, I do not understand _where_ I set > this option (in what file).Put this at the end of your config/environment.rb: # Set default time zone for ActiveRecord timestamping to UTC. ActiveRecord::Base.default_timezone = :utc Perhaps the timestamping documentation needs an update? timestamps_gmt was deprecated by Jamis Buck''s great timezone work. jeremy
3kru-hpyd-5+VhGm8TZF7QT0dZR+AlfA@public.gmane.org
2005-Mar-17 10:24 UTC
Re: Newbie ActiveRecord::TimeStamp questions
On Wed, 16 Mar 2005 13:37:18 -0800, Jeremy Kemper <jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> wrote:> Perhaps the timestamping documentation needs an update? timestamps_gmt > was deprecated by Jamis Buck''s great timezone work.Yes please! I am using SQL Server and created_on is being set to 2000-01-01 00:00:00 -- obviously incorrect. I have tried setting the field to both datetime and smalldatetime, with the same results. Has anyone else used these fields in SQL Server? Cheers, --John