Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# make this class in lib/transactional_requests.rb, and load it on start
require 'activerecord'
class TransactionalRequests
def initialize(app)
@app = app
end
def call(env)
ActiveRecord::Base.transaction do
@app.call(env)
end
end
end
# and in the app config
config.middleware.use "TransactionalRequest"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.