From bd603399639fe7dd12e532a89210760fa564440c Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sat, 21 Jan 2012 20:07:12 +0900 Subject: change AR default_timezone to :utc since it's the default for AR::Railtie --- activerecord/lib/active_record/core.rb | 6 +++--- activerecord/test/cases/base_test.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index e90503d173..adba3f710c 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -45,10 +45,10 @@ module ActiveRecord ## # :singleton-method: - # 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. + # Determines whether to use Time.utc (using :utc) or Time.local (using :local) when pulling + # dates and times from the database. This is set to :utc by default. config_attribute :default_timezone, :global => true - self.default_timezone = :local + self.default_timezone = :utc ## # :singleton-method: diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 3ab6973549..87a3a0deb9 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -689,7 +689,7 @@ class BasicsTest < ActiveRecord::TestCase } topic = Topic.find(1) topic.attributes = attributes - assert_equal Time.local(2004, 6, 24, 16, 24, 0), topic.written_on + assert_equal Time.utc(2004, 6, 24, 16, 24, 0), topic.written_on end def test_multiparameter_attributes_on_time_with_no_date @@ -938,7 +938,7 @@ class BasicsTest < ActiveRecord::TestCase } topic = Topic.find(1) topic.attributes = attributes - assert_equal Time.local(2000, 1, 1, 5, 42, 0), topic.bonus_time + assert_equal Time.utc(2000, 1, 1, 5, 42, 0), topic.bonus_time end def test_boolean -- cgit v1.2.3