Updates residence to handle CensusAPI's new response

This commit is contained in:
kikito
2016-04-12 18:19:05 +02:00
parent 4f724ef3bf
commit 7987a3410b
2 changed files with 3 additions and 12 deletions

View File

@@ -13,13 +13,9 @@ module ActiveModel::Dates
attrs.except("#{field}(1i)", "#{field}(2i)", "#{field}(3i)")
end
def date_to_string(date)
date.strftime("%d-%m-%Y")
end
def string_to_date(value)
day, month, year = value.split("-")
Date.new(year.to_i, month.to_i, day.to_i)
end
end
end