Logo Rails Bling
Logo Inverted Logo
  • Blog Setup
    • How I Go
    • How I Go Again
    • My Git Hooks
  • Clojure Thoughts
    • Clojourner in a Foreign Land
  • Decentralized Git
    • Give Up Github
    • Put the D in DVCS
  • Development Process
    • How to Agile
  • Local Development Setup
    • Upgrade to El Capitan
    • Upgrade to Catalina
    • Catalina Fresh Install
  • Ruby Thoughts
    • Fix Nokogiri Warning
  • RubyGems
    • Current List
    • Repair Old Gem (Part 1)
    • Repair Bundler (Part 2)
    • Upgrade RSpec (Part 3)
    • Upgrade Autotest (Part 4)
    • Rakefile & RuboCop LTS (Part 5)
Hero Image
Introducing activerecord-transactionable

Properly Implement ActiveRecord Transactions Provides a method, transaction_wrapper at the class and instance levels that can be used instead of ActiveRecord#transaction. Enables you to do transactions properly, with custom rescues and retry, including with or without locking. Installation Add this line to your application’s Gemfile: gem 'activerecord-transactionable' And then execute: $ bundle Or install it yourself as: $ gem install activerecord-transactionable Usage class Car < ActiveRecord::Base include Activerecord::Transactionable # Note lowercase "r" in Activerecord (different namespace than rails' module) validates_presence_of :name end When creating, saving, deleting within the transaction make sure to use the bang methods (!

March 28, 2016 Read
Navigation
  • About
  • Skills
  • Experience
  • Projects
Contact me:
  • peter.boling a@t gmail.com
  • +1-925-252-5351

Toha Theme Logo Toha (tweaked by @pboling)
© 2023 Peter Boling
CC BY-SA 4.0
Powered by Hugo Logo