mdsol/the_policy_machine — pull request #10 by HonoreDB (2014-01-06 17:41:10+00:00)
Title: Feature/optimized is privilege simple case

Does for `is_privilege?` what we did earlier for `scoped_privileges`: policy machine now delegates it to the adapter if the adapter supports it, and the ActiveRecord adapter then optimizes it to avoid O(number of associations) connectivity checks. The new spec illustrates why this is necessary. Without the optimization it fails, and if it didn't it would take roughly five times longer to run.

```
Finished in 1 minute 39.4 seconds
710 examples, 0 failures, 4 pending
Coverage report generated for RSpec to /Users/aweiner/the_policy_machine/coverage. 657 / 659 LOC (99.7%) covered.
```