fix plugin parser timezone spec in AR

This commit is contained in:
Adam Meehan 2010-09-24 13:45:55 +10:00
parent f41903a769
commit 7f297d576a
2 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ class ActiveRecord::Base
end
def timeliness_attribute_timezone_aware?(attr_name)
attr_name = attr_name.to_s
create_time_zone_conversion_attribute?(attr_name, columns_hash[attr_name])
end

View File

@ -51,11 +51,12 @@ describe ValidatesTimeliness, 'ActiveRecord' do
it 'should parse string as current timezone' do
r = EmployeeWithParser.new
r.birth_datetime = '2010-01-01 12:00'
r.birth_datetime.zone == Time.zone.name
r.birth_datetime = '2010-06-01 12:00'
r.birth_datetime.utc_offset.should == 10.hours
end
after :all do
Time.zone = 'Australia/Melbourne'
ValidatesTimeliness.use_plugin_parser = false
end
end