Browse files

Document using different types of objects as actors for different fea…

…tures.

Closes #11
  • Loading branch information...
1 parent 672aef6 commit 81cf2753c301f2b779f981a3f023b2a1bce030f4 @jnunemaker committed Jan 1, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 README.md
View
10 README.md
@@ -87,7 +87,7 @@ There is no requirement that the thing yielded to the block be a user model or w
### 3. Individual Actor
-Turn on for individual thing. Think enable feature for someone to test or for a buddy.
+Turn feature on for individual thing. Think enable feature for someone to test or for a buddy. The only requirement for an individual actor is that it must respond to `id`.
```ruby
flipper = Flipper.new(adapter)
@@ -97,8 +97,16 @@ flipper[:stats].enabled? user # true
flipper[:stats].disable user
flipper[:stats].disabled? user # true
+
+# you can enable anything, does not need to be user or person
+flipper[:search].enable group
+flipper[:search].enabled? group
```
+The key is to make sure you do not enable two different types of objects for the same feature. Imagine that user has an id of 6 and group has an id of 6. Enabling search for user would automatically enable it for group, as they both have an id of 6.
+
+The one exception to this rule is if you have globally unique ids, such as uuid's. If your ids are unique globally in your entire system, enabling two different types should be safe.
+
### 4. Percentage of Actors
Turn this on for a percentage of actors (think user, member, account, group, whatever). Consistently on or off for this user as long as percentage increases. Think slow rollout of a new feature to a percentage of things.

0 comments on commit 81cf275

Please sign in to comment.