Skip to content

Commit

Permalink
added doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieter Späth committed Feb 17, 2014
1 parent 006ca4e commit ccb03c9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Or install it yourself as:
class DummyController < ActionController::Base
# ... typical controller stuff

around_action :wrap_with_transaction # in case AccessPolicy::AuthorizeNotCalledError is raised, better tested in spec's that this does not happen


# instead of
#
# def create
Expand All @@ -41,6 +44,14 @@ Or install it yourself as:
guarded_action :show do

end

protected

def wrap_with_transaction
ActiveRecord::Base.transaction do
yield
end
end
end


Expand Down

0 comments on commit ccb03c9

Please sign in to comment.