aligns document verification with census API
This commit is contained in:
@@ -32,7 +32,7 @@ class Verification::Management::Document
|
|||||||
end
|
end
|
||||||
|
|
||||||
def under_sixteen?(response)
|
def under_sixteen?(response)
|
||||||
16.years.ago < string_to_date(response.date_of_birth)
|
16.years.ago < response.date_of_birth
|
||||||
end
|
end
|
||||||
|
|
||||||
def verified?
|
def verified?
|
||||||
@@ -43,4 +43,4 @@ class Verification::Management::Document
|
|||||||
user.update(verified_at: Time.now) if user?
|
user.update(verified_at: Time.now) if user?
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,9 +13,4 @@ module ActiveModel::Dates
|
|||||||
attrs.except("#{field}(1i)", "#{field}(2i)", "#{field}(3i)")
|
attrs.except("#{field}(1i)", "#{field}(2i)", "#{field}(3i)")
|
||||||
end
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user