Skip to content

Instantly share code, notes, and snippets.

@rubyrider
Last active August 29, 2015 14:00
Show Gist options
  • Save rubyrider/11131845 to your computer and use it in GitHub Desktop.
Save rubyrider/11131845 to your computer and use it in GitHub Desktop.
Payment.transaction(isolation: :serializable) do # a postgresql feature for uniq transaction available on rails4 now
Payment.with(:line_item_id => line_item_id, :service_id => service_id) do |payment|
payment.process #
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment