mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
fix plugin parser timezone spec in AR
This commit is contained in:
parent
f41903a769
commit
7f297d576a
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user