README.md in consul-0.12.4 vs README.md in consul-0.13.0
- old
+ new
@@ -6,11 +6,11 @@
Consul is an authorization solution for Ruby on Rails where you describe *sets of accessible things* to control what a user can see or edit.
We have used Consul in combination with [assignable_values](https://github.com/makandra/assignable_values) to solve a variety of authorization requirements ranging from boring to bizarre.
Also see our crash course video: [Solving bizare authorization requirements with Rails](http://bizarre-authorization.talks.makandra.com/).
-Consul is tested with Rails 2.3, 3.2, 4.1, 4.2.7, and 5.1.1 on Ruby 1.8.7, 2.1.0, 2.2.6, and 2.4.1 (only if supported, for each Ruby/Rails combination).
+Consul is tested with Rails 2.3, 3.2, 4.2, and 5.1 on Ruby 1.8.7, 2.1, and 2.4 (only if supported, for each Ruby/Rails combination).
Describing access to your application
-------------------------------------
@@ -625,9 +625,28 @@
The `authorize_values_for` macro comes with many useful options and details best explained in the [assignable_values README](https://github.com/makandra/assignable_values), so head over there for more. The macro is basically a shortcut for this:
```rb
assignable_values_for :field, :through => lambda { Power.current }
```
+
+Memoization
+-----------
+
+All power methods are [memoized](https://www.justinweiss.com/articles/4-simple-memoization-patterns-in-ruby-and-one-gem/) for performance reasons. Multiple calls to the same method will only call your block the first time, and return a cached result afterwards:
+
+```
+power = Power.new
+power.projects! # calls the `power :projects { ... }` block
+power.projects! # returns the cached result from earlier
+power.projects! # returns the cached result from earlier
+```
+
+If you want to discard all cached results, call `#unmemoize_all`:
+
+```
+power.unmemoize_all
+```
+
Dynamic power access
--------------------
Consul gives you a way to dynamically access and query powers for a given name, model class or record.