Skip to content

Instantly share code, notes, and snippets.

@shotgundebugging
Created February 12, 2026 12:31
Show Gist options
  • Select an option

  • Save shotgundebugging/507f94ab431fbc6af19099986e5baf99 to your computer and use it in GitHub Desktop.

Select an option

Save shotgundebugging/507f94ab431fbc6af19099986e5baf99 to your computer and use it in GitHub Desktop.
open_tx = ActiveRecord::Base.connection.open_transactions
Rails.logger.info(
"[TX_DEBUG] before_write user_id=#{user.id} open_transactions=#{open_tx} [/TX_DEBUG]"
)
user.update!(stripe_customer_id: stripe_customer.id)
Rails.logger.info(
"[TX_DEBUG] after_write user_id=#{user.id} stripe_customer_id=#{User.where(id: user.id).pick(:stripe_customer_id).inspect} " \
"open_transactions=#{open_tx} rollback_risk=#{open_tx.positive?} [/TX_DEBUG]"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment