aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-08-05 20:50:26 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-08-05 20:50:26 +0000
commitc99df461f45c514d434a6f0bcb368320b71fd0c8 (patch)
tree92fb1035099cdb40281800070b4aa8ba6ecb3e19 /activerecord/lib
parent5130fc84c602001d31454a5631ee7b354d197663 (diff)
downloadrails-c99df461f45c514d434a6f0bcb368320b71fd0c8.tar.gz
rails-c99df461f45c514d434a6f0bcb368320b71fd0c8.tar.bz2
rails-c99df461f45c514d434a6f0bcb368320b71fd0c8.zip
Fixed that default timezones for new / initialize should uphold utc setting (closes #5709) [daniluk@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4670 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 40dfb387ce..1d9f0175bd 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1996,7 +1996,7 @@ module ActiveRecord #:nodoc:
send(name + "=", nil)
else
begin
- send(name + "=", Time == klass ? klass.local(*values) : klass.new(*values))
+ send(name + "=", Time == klass ? (@@default_timezone == :utc ? klass.utc(*values) : klass.local(*values)) : klass.new(*values))
rescue => ex
errors << AttributeAssignmentError.new("error on assignment #{values.inspect} to #{name}", ex, name)
end