mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fixes OCI adapter failure on timezone tests #700
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@778 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -55,13 +55,14 @@ begin
|
||||
|
||||
def cast_to_date_or_time(value)
|
||||
return value if value.is_a? Date
|
||||
guess_date_or_time (value.is_a? Time) ?
|
||||
value : Time.local(*value.split(/\D+/).map{ |x| x.to_i })
|
||||
guess_date_or_time (value.is_a? Time) ? value : cast_to_time(value)
|
||||
end
|
||||
|
||||
def cast_to_time(value)
|
||||
return value if value.is_a? Time
|
||||
Time.local(2000, 1, 1,*value.split(/\D+/).map{ |x| x.to_i })
|
||||
time_array = ParseDate.parsedate value
|
||||
time_array[0] ||= 2000; time_array[1] ||= 1; time_array[2] ||= 1;
|
||||
Time.send Base.default_timezone, *time_array
|
||||
end
|
||||
|
||||
def guess_date_or_time(value)
|
||||
|
||||
Reference in New Issue
Block a user