Permalink
Browse files

fix timezone issue in tests on ruby 1.9

  • Loading branch information...
1 parent db54baa commit 07a75f398ff1958515d625bc98826fc4ee937372 @mislav committed Jul 29, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 test/lib/activerecord_test_connector.rb
@@ -2,6 +2,10 @@
require 'active_record/version'
require 'active_record/fixtures'
+# prevent psych kicking in on 1.9 and interpreting
+# local timestamps in fixtures as UTC
+YAML::ENGINE.yamler = 'syck' if defined? YAML::ENGINE
+
class ActiveRecordTestConnector
cattr_accessor :able_to_connect
cattr_accessor :connected
@@ -44,7 +48,7 @@ def self.setup_connection
ActiveRecord::Base.establish_connection(configuration)
ActiveRecord::Base.configurations = { db => configuration }
- ActiveRecord::Base.default_timezone = :utc if ActiveRecord::Base.respond_to? :default_timezone
+ ActiveRecord::Base.default_timezone = :local if ActiveRecord::Base.respond_to? :default_timezone
prepare ActiveRecord::Base.connection
unless Object.const_defined?(:QUOTED_TYPE)

0 comments on commit 07a75f3

Please sign in to comment.