aligns document verification with census API

This commit is contained in:
kikito
2016-04-12 18:35:23 +02:00
parent 708b77721c
commit 3880ef9e24
2 changed files with 2 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ class Verification::Management::Document
end
def under_sixteen?(response)
16.years.ago < string_to_date(response.date_of_birth)
16.years.ago < response.date_of_birth
end
def verified?
@@ -43,4 +43,4 @@ class Verification::Management::Document
user.update(verified_at: Time.now) if user?
end
end
end

View File

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