Sha256: a78e45fef4b207ba5faa3be7a6dd2a6d8d6850a3ce12c0b751ebb41633046a12
Contents?: true
Size: 1008 Bytes
Versions: 2
Compression:
Stored size: 1008 Bytes
Contents
= ActsAsApprovable +acts_as_approvable+ is an ActiveRecord extension that allows you to flag models as pending approval. One use of this would be so that changes would not show up in your views until the model has been "approved". == Installation In +Gemfile+: gem 'acts_as_approvable', :git => 'https://github.com/iamvery/acts_as_approvable.git' In your application root, run: $ bundle install Generate the migration (warning: will overwrite any table named +Approvals+): $ rails g acts_as_approvable:install == Usage Declare +acts_as_approvable+ on your models: class Thing < ActiveRecord::Base acts_as_approvable end Doing so will add the following methods to your model: * thing.pending? * thing.approved? * thing.approve! * thing.disapprove! Both +pending?+ and +approved?+ exist as convenience methods. +approve!+ and +disapprove!+ will modify the +Approval+ model that your +acts_as_approvable+ model has. == Compatibility This gem is designed to work with Rails 3.x.
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
acts_as_approvable-0.1.1 | README.rdoc |
acts_as_approvable-0.1.0 | README.rdoc |