From 3a55cbab48da4a559b775c3878bf085c18c39685 Mon Sep 17 00:00:00 2001 From: Ryan Lyu Date: Mon, 1 Aug 2022 14:15:15 +0800 Subject: [PATCH] bugfix: candidate_id should be a string Problem: when retrieving the report, the candidate is a json object. alias method can't delegate `candidate_id` to the candidate object. What's the change? explicitly define the method to access the candidate_id --- lib/checkr/report.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/checkr/report.rb b/lib/checkr/report.rb index 5ef90a5..65aa4f3 100644 --- a/lib/checkr/report.rb +++ b/lib/checkr/report.rb @@ -8,10 +8,10 @@ class Report < APIResource attribute :turnaround_time attribute :package attribute :values + attribute :candidate_id attribute :candidate, :Candidate - attribute_writer_alias :candidate_id, :candidate - attribute :adverse_items, :AdverseItemList, :nested => true, :default => {} + attribute :adverse_items, :AdverseItemList, nested: true, default: {} attribute_writer_alias :adverse_item_ids, :adverse_items attribute :ssn_trace, :SSNTrace @@ -47,10 +47,10 @@ class Report < APIResource attribute :documents, APIList.constructor(:Document) attribute_writer_alias :document_ids, :documents - attribute :geos, APIList.constructor(:Geo), :default => {} + attribute :geos, APIList.constructor(:Geo), default: {} attribute_writer_alias :geo_ids, :geos - attribute :verifications, :VerificationList, :nested => true, :default => {} + attribute :verifications, :VerificationList, nested: true, default: {} attribute_writer_alias :verification_ids, :verifications attribute :education_verification, :EducationVerification @@ -59,15 +59,16 @@ class Report < APIResource attribute :employment_verification, :EmploymentVerification attribute_writer_alias :employment_verification_id, :employment_verification - api_class_method :retrieve, :get, ":path/:id", :arguments => [:id] + api_class_method :retrieve, :get, ':path/:id', arguments: [:id] api_class_method :create, :post - api_instance_method :save, :post, :default_params => :changed_attributes + api_instance_method :save, :post, default_params: :changed_attributes def self.path - "/v1/reports" + '/v1/reports' end - APIClass.register_subclass(self, "report") + APIClass.register_subclass(self, 'report') + end end