diff options
| author | mo khan <mo@mokhan.ca> | 2017-02-11 15:27:54 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2017-02-11 15:27:54 -0700 |
| commit | b1ce210bf25c89645cd73cd4c7bfb933c9f806e9 (patch) | |
| tree | d6fae1a855d136bba4e51077f066332f814042cf /app/controllers/application_controller.rb | |
| parent | 77bc181227377055975f16b384a72803e3c7d06e (diff) | |
within_transaction
Diffstat (limited to 'app/controllers/application_controller.rb')
| -rw-r--r-- | app/controllers/application_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 79d6eb7..d6fb001 100644 --- a/app/controllers/application_controller.rb +++ b/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 + |
