mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
fix multiparam extension
This commit is contained in:
parent
5d495505d9
commit
ab8d680383
@ -22,7 +22,7 @@ module ValidatesTimeliness
|
|||||||
if self.class.send(:create_time_zone_conversion_attribute?, name, column_for_attribute(name))
|
if self.class.send(:create_time_zone_conversion_attribute?, name, column_for_attribute(name))
|
||||||
Time.zone.local(*values)
|
Time.zone.local(*values)
|
||||||
else
|
else
|
||||||
Time.time_with_datetime_fallback(@@default_timezone, *values)
|
Time.time_with_datetime_fallback(self.class.default_timezone, *values)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -10,11 +10,10 @@ describe ValidatesTimeliness::Extensions::MultiparameterHandler do
|
|||||||
it 'should return string value for invalid datetimes' do
|
it 'should return string value for invalid datetimes' do
|
||||||
instantiate_time_object('birth_datetime', [2000, 2, 31, 12, 0, 0]).should == '2000-02-31 12:00:00'
|
instantiate_time_object('birth_datetime', [2000, 2, 31, 12, 0, 0]).should == '2000-02-31 12:00:00'
|
||||||
end
|
end
|
||||||
|
|
||||||
# This is giving an error in AR for undefined @@default_timezone.
|
it 'should return Time value for valid datetimes' do
|
||||||
# it 'should return Time value for valid datetimes' do
|
instantiate_time_object('birth_datetime', [2000, 2, 28, 12, 0, 0]).should be_kind_of(Time)
|
||||||
# instantiate_time_object('birth_datetime', [2000, 2, 28, 12, 0, 0]).should be_find_of(Time)
|
end
|
||||||
# end
|
|
||||||
|
|
||||||
def instantiate_time_object(name, values)
|
def instantiate_time_object(name, values)
|
||||||
employee.send(:instantiate_time_object, name, values)
|
employee.send(:instantiate_time_object, name, values)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user