ApprovalCycle
Short description and motivation.
Usage
How to use my plugin.
Installation
Add this line to your application's Gemfile:
gem "approval_cycle"
And then execute:
$ bundle
Or install it yourself as:
$ gem install approval_cycle
Contributing
Contribution directions go here.
License
The gem is available as open source under the terms of the MIT License.
How to Use
- Add the gem to your Gemfile:
gem 'approval_cycle'
- Run
bundle install
to install the gem. - Add the initializer file with types (models that you want to be approvable):
rails generate approval_cycle:install
- Customize the generated initializer file (
config/initializers/approval_cycle.rb
) to fit your application's needs. In the initializer, set up the approval cycle types:
ApprovalCycle.configure do |config|
config.approval_cycle_setup_types = { dummy_request: 0 }
end
- Run the migrations:
rails db:migrate
- Include
ApprovalCycle::Approvable
in your models that require approval workflows:
class YourModel < ApplicationRecord
include ApprovalCycle::Approvable
end
- Approval cycle uses versioning for the approval cycle setups to not mess with old approvable records after updating the setup. To use the versioning, you must update your approval cycle setup with the
SetupUpdater
service:
ApprovalCycle::SetupUpdater.call(approval_cycle_setup: your_approval_cycle_setup_record, params: {attributes to update}, apply_to_versions: {true | false})