Task: parse individual_date

This commit is contained in:
simon lehericey 2018-04-03 12:11:17 +02:00
parent 8828663880
commit 6370365fe4

View file

@ -0,0 +1,14 @@
namespace :'2018_04_03_type_individual_date' do
task set: :environment do
Individual.all.each { |individual| save_birthdate_in_datetime_format(individual) }
end
def save_birthdate_in_datetime_format(individual)
if individual.birthdate.present?
begin
individual.update_column(:second_birthdate, Date.parse(individual.birthdate))
rescue
end
end
end
end