From 60de8c110829cb7f2df1d312ad2898633e896c24 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 28 Dec 2004 17:30:17 +0000 Subject: Added Base.default_timezone accessor that determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database. This is set to :local by default. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@271 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/lib/active_record/base.rb') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index ce10f03789..12f39c6985 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -221,6 +221,11 @@ module ActiveRecord #:nodoc: cattr_accessor :pluralize_table_names @@pluralize_table_names = true + # Determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database. + # This is set to :local by default. + cattr_accessor :default_timezone + @@default_timezone = :local + # When turned on (which is default), all associations are included using "load". This mean that any change is instant in cached # environments like mod_ruby or FastCGI. When set to false, "require" is used, which is faster but requires server restart to # reflect changes. -- cgit v1.2.3