mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
renamed calls to timeliness_date_time_parse to parse_date_time which will correctly an overrided method
This commit is contained in:
parent
539f823b8b
commit
5e08a10fb0
@ -35,7 +35,7 @@ module ValidatesTimeliness
|
|||||||
|
|
||||||
# Does strict time type cast checking for Rails 2.1 timezone handling
|
# Does strict time type cast checking for Rails 2.1 timezone handling
|
||||||
def strict_time_type_cast(time)
|
def strict_time_type_cast(time)
|
||||||
time = self.class.timeliness_date_time_parse(time, :datetime)
|
time = self.class.parse_date_time(time, :datetime)
|
||||||
time_in_time_zone(time)
|
time_in_time_zone(time)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -132,7 +132,7 @@ module ValidatesTimeliness
|
|||||||
when Proc
|
when Proc
|
||||||
restriction.call(record)
|
restriction.call(record)
|
||||||
else
|
else
|
||||||
timeliness_date_time_parse(restriction, configuration[:type], false)
|
parse_date_time(restriction, configuration[:type], false)
|
||||||
end
|
end
|
||||||
|
|
||||||
next if compare.nil?
|
next if compare.nil?
|
||||||
|
|||||||
@ -21,7 +21,7 @@ describe ValidatesTimeliness::AttributeMethods do
|
|||||||
strict_time_type_cast("2000-02-01 25:13:14").should be_nil
|
strict_time_type_cast("2000-02-01 25:13:14").should be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should return time object for time object" do
|
it "should return Time object when passed a Time object" do
|
||||||
strict_time_type_cast(Time.now).should be_kind_of(Time)
|
strict_time_type_cast(Time.now).should be_kind_of(Time)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user