Permalink
Browse files

Merge pull request #4573 from amatsuda/ar_default_timezone_utc

change AR default_timezone to :utc since it's the default for AR::Railtie
  • Loading branch information...
2 parents c05f3b0 + bd60339 commit a50382cacdfa2e30c882f9f462e982d78e3e8ef5 @josevalim josevalim committed Jan 21, 2012
Showing with 5 additions and 5 deletions.
  1. +3 −3 activerecord/lib/active_record/core.rb
  2. +2 −2 activerecord/test/cases/base_test.rb
@@ -45,10 +45,10 @@ module Core
##
# :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:
@@ -689,7 +689,7 @@ def test_multiparameter_attributes_on_time
}
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 @@ def test_attributes_on_dummy_time
}
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

0 comments on commit a50382c

Please sign in to comment.