aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-28 17:30:17 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-28 17:30:17 +0000
commit60de8c110829cb7f2df1d312ad2898633e896c24 (patch)
treecc6fafcc057c94bbda035f3277324a24368a418c /activerecord/lib/active_record/base.rb
parent8a9b998b7960ba171d77cc11bb4f4c318a05ac46 (diff)
downloadrails-60de8c110829cb7f2df1d312ad2898633e896c24.tar.gz
rails-60de8c110829cb7f2df1d312ad2898633e896c24.tar.bz2
rails-60de8c110829cb7f2df1d312ad2898633e896c24.zip
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
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb5
1 files changed, 5 insertions, 0 deletions
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.