Permalink
Browse files

Merge branch 'release/new_and_improved'

  • Loading branch information...
2 parents ff2d10e + b020a6c commit 12656cd270219571cc675de1cc99c62a540eb72b bokmann committed Dec 23, 2010
Showing with 10 additions and 2 deletions.
  1. +1 −1 Rakefile
  2. +1 −1 VERSION
  3. +8 −0 lib/sentient_user.rb
View
@@ -10,7 +10,7 @@ begin
gem.email = "dbock@codesherpas.com"
gem.homepage = "http://github.com/bokmann/sentient_user"
gem.authors = ["bokmann"]
- gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
+ gem.add_development_dependency "shoulda", ">= 2.11.3"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
View
@@ -1 +1 @@
-0.3.0
+0.3.1
View
@@ -19,6 +19,14 @@ def make_current
def current?
!Thread.current[:user].nil? && self.id == Thread.current[:user].id
end
+
+ def self.do_as(user, &block)
+ old_user = self.current
+ self.current = user
+ response = block.call unless block.nil?
+ self.current = old_user
+ response
+ end
}
end
end

0 comments on commit 12656cd

Please sign in to comment.