lib/codat/models/report.rb in codat-0.1.4 vs lib/codat/models/report.rb in codat-0.1.5
- old
+ new
@@ -14,10 +14,10 @@
def self.all(company_id:)
url = format_url(ENDPOINT, company_id: company_id.to_s.strip)
result = get(url)
- return [] if result.status == 404
+ return [] unless successful_response?(result)
result.body[:data].map { |report| new(json: report) }
end
end
end