[Fix #1475] Ensure date is parsable before doing it (to avoid errors)
This commit is contained in:
parent
b8958add7a
commit
3db941ea06
2 changed files with 36 additions and 1 deletions
|
@ -12,7 +12,8 @@ class Individual < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def set_iso_date
|
||||
if birthdate.present?
|
||||
if birthdate.present? &&
|
||||
birthdate =~ /\A\d{2}\/\d{2}\/\d{4}\z/
|
||||
self.birthdate = Date.parse(birthdate).iso8601
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue