Create Management::Document initialize

Allow parse :date_of_birth on Management::Document initialize
This commit is contained in:
taitus
2019-05-14 12:36:20 +02:00
committed by Javi Martín
parent ceaf118188
commit c0c967b961

View File

@@ -8,6 +8,12 @@ class Verification::Management::Document
delegate :username, :email, to: :user, allow_nil: true
def initialize(attrs = {})
self.date_of_birth = parse_date("date_of_birth", attrs)
attrs = remove_date("date_of_birth", attrs)
super
end
def user
@user = User.active.by_document(document_type, document_number).first
end