Fixed create new customer

This commit is contained in:
2026-03-05 21:33:49 -05:00
parent 2520892e2c
commit 00b1baa1f3

View File

@@ -35,7 +35,7 @@ class Customer < ActiveRecord::Base
# Returns the details of the customer. If the details have already been fetched, it returns the cached version. Otherwise, it fetches the details from QuickBooks Online and caches them for future use. This method is used to access the customer's information in a way that minimizes unnecessary API calls to QBO, improving performance and reducing latency. # Returns the details of the customer. If the details have already been fetched, it returns the cached version. Otherwise, it fetches the details from QuickBooks Online and caches them for future use. This method is used to access the customer's information in a way that minimizes unnecessary API calls to QBO, improving performance and reducing latency.
def details def details
return Quickbooks::Model::Customer.new unless id.present? return (@details ||= Quickbooks::Model::Customer.new) if new_record?
@details ||= begin @details ||= begin
xml = Rails.cache.fetch(details_cache_key, expires_in: 10.minutes) do xml = Rails.cache.fetch(details_cache_key, expires_in: 10.minutes) do