lib/onfido/resources/document.rb in onfido-0.8.4 vs lib/onfido/resources/document.rb in onfido-0.9.0
- old
+ new
@@ -1,10 +1,11 @@
module Onfido
class Document < Resource
# with open-uri the file can be a link or an actual file
def create(applicant_id, payload)
- payload[:file] = open(payload.fetch(:file), 'r')
+ validate_file!(payload.fetch(:file))
+
post(
url: url_for("applicants/#{applicant_id}/documents"),
payload: payload
)
end