Skip to content
Create a gist now

Instantly share code, notes, and snippets.

reproduces issue 3965 config.time_zone and datetime update
gem 'rails', '3.2.1'
require 'active_record'
# Print out what version we're running
puts "Active Record #{ActiveRecord::VERSION::STRING}"
ActiveRecord::Base.time_zone_aware_attributes = true
ActiveRecord::Base.default_timezone = :utc = 'Amsterdam'
# Connect to an in-memory sqlite3 database
:adapter => 'sqlite3',
:database => ':memory:'
# Create schema
ActiveRecord::Schema.define do
create_table :foos, :force => true do |t|
t.datetime :bar
# Create the a model
class Foo < ActiveRecord::Base
# reproduce bug
foo = Foo.create(:bar => "2012-02-20 10:00:00") = "2012-02-20 09:00:00"
# expected: true
puts foo.bar_changed? = "2012-02-20 10:00:00"
# expected: false
puts foo.bar_changed?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.