From fbc702c760d27c465be738769c7572679efa0d92 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 27 Jan 2009 20:21:27 -0300 Subject: [PATCH] ActionItem916: porting to etch's Ruby --- db/migrate/059_add_birth_date_to_person.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/059_add_birth_date_to_person.rb b/db/migrate/059_add_birth_date_to_person.rb index 3e06799..6f3bed9 100644 --- a/db/migrate/059_add_birth_date_to_person.rb +++ b/db/migrate/059_add_birth_date_to_person.rb @@ -18,8 +18,8 @@ class AddBirthDateToPerson < ActiveRecord::Migration date_string = date_string[0..-3] + (year > (Date.today.year - 2000) ? year + 1900 : year + 2000).to_s end - date_string.gsub!('/', '.') - Date.parse(date_string) + date_string =~ (/(\d+)[^\d]+(\d+)[^\d]+(\d+)/) + Date.new($3.to_i, $2.to_i, $1.to_i) end end -- libgit2 0.21.2