Browse files

Improve comment

  • Loading branch information...
Nathan Long
Nathan Long committed May 12, 2012
1 parent a2b69de commit 6c23712d077d1d08da223d66ee3ee68454e472ed
Showing with 3 additions and 2 deletions.
  1. +3 −2 spec/authority/abilities_spec.rb
@@ -91,8 +91,9 @@
@ability_model.should respond_to(:authorizer)
- # TODO: Nathan will comment more clearly in the future
- # aka "don't memoize" (to prevent dirty models from contaminating authorization)
+ # When checking instance methods, we want to ensure that every check uses a new
+ # instance of the authorizer. Otherwise, you might check, make a change to the
+ # model instance, check again, and get an outdated answer.
it "should always create a new authorizer instance when accessing the authorizer" do
2.times { @ability_model.authorizer }

0 comments on commit 6c23712

Please sign in to comment.