module Pay::Billable::SyncCustomer

Public Instance Methods

pay_should_sync_customer?() click to toggle source
# File lib/pay/billable/sync_customer.rb, line 14
def pay_should_sync_customer?
  try(:saved_change_to_email?)
end

Private Instance Methods

enqeue_sync_email_job() click to toggle source
# File lib/pay/billable/sync_customer.rb, line 20
def enqeue_sync_email_job
  if saved_change_to_email?
    # Queue job to update each payment processor for this customer
    pay_customers.pluck(:id).each do |pay_customer_id|
      CustomerSyncJob.perform_later(pay_customer_id)
    end
  end
end