Commit fbc702c760d27c465be738769c7572679efa0d92

Authored by Antonio Terceiro
1 parent fe11a9f3

ActionItem916: porting to etch's Ruby

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
db/migrate/059_add_birth_date_to_person.rb
... ... @@ -18,8 +18,8 @@ class AddBirthDateToPerson < ActiveRecord::Migration
18 18 date_string = date_string[0..-3] + (year > (Date.today.year - 2000) ? year + 1900 : year + 2000).to_s
19 19 end
20 20  
21   - date_string.gsub!('/', '.')
22   - Date.parse(date_string)
  21 + date_string =~ (/(\d+)[^\d]+(\d+)[^\d]+(\d+)/)
  22 + Date.new($3.to_i, $2.to_i, $1.to_i)
23 23 end
24 24 end
25 25  
... ...