validates acceptance of census terms of service

This commit is contained in:
rgarcia
2015-08-30 12:50:17 +02:00
parent 92940c9f91
commit 9abd794133
5 changed files with 16 additions and 2 deletions

View File

@@ -2,12 +2,13 @@ class Verification::Residence
include ActiveModel::Model
include ActiveModel::Dates
attr_accessor :user, :document_number, :document_type, :date_of_birth, :postal_code
attr_accessor :user, :document_number, :document_type, :date_of_birth, :postal_code, :terms_of_service
validates_presence_of :document_number
validates_presence_of :document_type
validates_presence_of :date_of_birth
validates_presence_of :postal_code
validates :terms_of_service, acceptance: { allow_nil: false }
validates :postal_code, length: { is: 5 }