0.0
The project is in a healthy, maintained state
Approval Cycle is a Ruby gem designed to help manage and automate approval workflows within your Rails application. It provides a simple and flexible way to define, track, and enforce approval processes for various resources.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

Runtime

>= 0
>= 7.1.3.2
 Project Readme

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

  1. Add the gem to your Gemfile:
gem 'approval_cycle'
  1. Run bundle install to install the gem.
  2. Add the initializer file with types (models that you want to be approvable):
rails generate approval_cycle:install
  1. 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
  1. Run the migrations:
rails db:migrate
  1. Include ApprovalCycle::Approvable in your models that require approval workflows:
class YourModel < ApplicationRecord
  include ApprovalCycle::Approvable
end
  1. 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})