README.md in flip-1.0.1 vs README.md in flip-1.1.0

- old
+ new

@@ -19,11 +19,11 @@ There is also a configurable system-wide default - !Rails.env.production?` works nicely. Flip has a dashboard UI that's easy to understand and use. -![Feature Flipper Dashboard](https://dl.dropbox.com/u/13833591/flip-gem-dashboard.png "Feature Flipper Dashboard") +![Feature Flipper Dashboard](https://cloud.githubusercontent.com/assets/828243/4934741/a5773568-65a4-11e4-98d8-5e9a32720b2e.png) Install ------- **Rails 3.0, 3.1 and 3.2+** @@ -65,11 +65,11 @@ default: proc { rand(2).zero? } # Provide a description, normally derived from the feature name. feature :something, default: true, - description: "Ability to purchase enrollments in courses", + description: "Ability to purchase enrollments in courses" end ``` @@ -98,11 +98,11 @@ Feature Flipping Controllers ---------------------------- -The `Flip::ControllerFilters` module is mixed into the base `ApplicationController` class. The following controller will respond with 404 Page Not Found to all but the `index` action unless the :new_stuff feature is enabled: +The `Flip::ControllerFilters` module is mixed into the base `ApplicationController` class. The following controller will respond with 404 Page Not Found to all but the `index` action unless the `:something` feature is enabled: ```ruby class SampleController < ApplicationController require_feature :something, :except => :index @@ -132,19 +132,19 @@ app/controllers/admin/features_controller.rb: ```ruby class Admin::FeaturesController < Flip::FeaturesController - before_filter :assert_authenticated_as_admin + before_action :assert_authenticated_as_admin end ``` app/controllers/admin/strategies_controller.rb: ```ruby class Admin::StrategiesController < Flip::StrategiesController - before_filter :assert_authenticated_as_admin + before_action :assert_authenticated_as_admin end ``` routes.rb: @@ -155,9 +155,26 @@ end end mount Flip::Engine => "/admin/features" ``` + +Cacheable +--------- + +You can optimize your feature to ensure that it doesn't make a ton of feature +calls by adding Cacheable to your model. +```ruby +extend Flip::Cacheable +``` + +This will ensure that your features are eager loaded with one call to the database +instead of every call to Flip#on? generating a call to the database. This is +helpful if you have a larger Rails application and more than a few features +defined. + +To start or reset the cache, just call #start_feature_cache. + ---- Created by Paul Annesley Copyright © 2011-2013 Learnable Pty Ltd, [MIT Licence](http://www.opensource.org/licenses/mit-license.php).