Skip to content

Commit

Permalink
Add Douglas.with_stamper
Browse files Browse the repository at this point in the history
  • Loading branch information
fteem committed Apr 5, 2017
1 parent fe2bbbd commit c72f41c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/douglas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ def the_stamper
def the_stamper= user
RequestStore.store[:the_stamper] = user
end

def with_stamper user
return unless block_given?

self.the_stamper = user
yield
self.the_stamper = nil
end
end
end

Expand Down

0 comments on commit c72f41c

Please sign in to comment.