aligns rake task with Census API response

This commit is contained in:
kikito
2016-04-12 18:22:38 +02:00
parent 7987a3410b
commit 708b77721c

View File

@@ -46,7 +46,7 @@ namespace :users do
begin begin
response = CensusApi.new.call(u.document_type, u.document_number) response = CensusApi.new.call(u.document_type, u.document_number)
if response.valid? if response.valid?
u.genre = response.genre == 'Varón' ? 'male' : 'female' u.genre = response.genre
u.date_of_birth = response.date_of_birth.to_datetime u.date_of_birth = response.date_of_birth.to_datetime
u.save u.save
print "." print "."