Pravangi (ਪ੍ਰਵਾਨਗੀ)
ਪ੍ਰਵਾਨਗੀ (pravangi) : Let's you add an approval process on top of your models/objects. Assume you have an object which is in an approved
state, you want any subsequent changes to this model to go into a review queue and have someone review these changes until they are actually committed to the object.
Installation
Rails 3 & 4
Add pravangi to your
Gemfile
.gem 'pravangi'
Generate a migration which will add a
pending_approvals
table to your database.bundle exec rails generate pravangi:install
Run the migration.
bundle exec rake db:migrate
Add
requires_approval
to the models you want to track.
API Summary
When you declare requires_approval
in your model, you get these methods:
class Article < ActiveRecord::Base
requires_approval # you can pass various options here
end
# check if this object requires any approval?
article.pending_approval?
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
You get extra attention, if your PR includes specs/tests.
- Fork or clone the project.
- Create your feature branch (
$ git checkout -b my-new-feature
) - Install the dependencies by doing:
$ bundle install
in the project directory. - Add your bug fixes or new feature code.
- New features should include new specs/tests.
- Bug fixes should ideally include exposing specs/tests.
- Commit your changes (
$ git commit -am 'Add some feature'
) - Push to the branch (
$ git push origin my-new-feature
) - Open your Pull Request!
License
Copyright (c) 2013 Jasdeep Singh (Metaware Labs Inc)
Licensed under the MIT license.