includes all date in document age verification

This commit is contained in:
Juanjo Bazán
2015-10-19 12:18:42 +02:00
parent 0a668ae39a
commit 07117f4a49
2 changed files with 39 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
class Verification::Management::Document
include ActiveModel::Model
include ActiveModel::Dates
attr_accessor :document_type
attr_accessor :document_number
@@ -31,7 +32,7 @@ class Verification::Management::Document
end
def under_sixteen?(response)
16.years.ago.year < response.date_of_birth.to_date.year
16.years.ago < string_to_date(response.date_of_birth)
end
def verified?