Commit b1ce210
Changed files (2)
app
controllers
app/controllers/application_controller.rb
@@ -16,4 +16,11 @@ class ApplicationController < ActionController::Base
def record_not_found
render text: "404 Not Found", status: 404
end
+
+ def within_transaction
+ ActiveRecord::Base.transaction do
+ yield
+ end
+ end
end
+
app/controllers/registrations_controller.rb
@@ -1,4 +1,6 @@
class RegistrationsController < PublicController
+ around_action :within_transaction, only: :create
+
def new
@user = User.new
end