Sha256: ed8369e3a98b1ed6d190f20da199b3322ba19beb90ecc20e6567a6b8993f5511
Contents?: true
Size: 612 Bytes
Versions: 28
Compression:
Stored size: 612 Bytes
Contents
module ActsAsSubscribableBuyer extend ActiveSupport::Concern module ActiveRecord def acts_as_subscribable_buyer(*options) include ::ActsAsSubscribableBuyer end end included do has_one :customer, class_name: 'Effective::Customer' before_save(if: -> { persisted? && email_changed? && customer.present? }) do Rails.logger.info "STRIPE CUSTOMER EMAIL UPDATE: #{customer.stripe_customer_id}" customer.stripe_customer.email = email customer.stripe_customer.description = to_s throw :abort unless (customer.stripe_customer.save rescue false) end end end
Version data entries
28 entries across 28 versions & 1 rubygems