
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
ApprovalCycle is a flexible Rails engine that provides a comprehensive approval workflow system for your Rails applications. It allows you to easily add multi-step approval processes to any model, with support for parallel approvals, watchers, action takers, and versioned approval setups.
Perfect for applications that need approval workflows for:
Add this line to your application's Gemfile:
gem "approval_cycle"
And then execute:
$ bundle
Or install it yourself as:
$ gem install approval_cycle
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.
gem 'approval_cycle'
bundle install
to install the gem.rails generate approval_cycle:install
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
Define which models in your application can have approval workflows:
ApprovalCycle.configure do |config|
config.approval_cycle_setup_types = {
dummy_request: 0,
purchase_order: 1,
expense_report: 2
}
end
Customize the approval statuses available in your application. If not provided, the gem will use the default statuses:
ApprovalCycle.configure do |config|
config.approval_statuses = {
pending: "pending",
approved: "approved",
rejected: "rejected",
cancelled: "cancelled",
on_hold: "on_hold"
}
end
Default statuses: pending
, rejected
, approved
, skipped
, auto_approved
, skipped_after_rejection
, skipped_after_withdrawal
5. Generate migrations for your configured types:
# Check which columns are missing
rails generate approval_cycle:setup_types --status
# Generate migration to add approval cycle columns to your models
# This will also automatically add ApprovalCycle::Approvable to your model files
rails generate approval_cycle:setup_types
rails db:migrate
SetupUpdater
service:ApprovalCycle::SetupUpdater.call(approval_cycle_setup: your_approval_cycle_setup_record, params: {attributes to update}, apply_to_versions: {true | false})
When you need to add new approval types to your application:
config/initializers/approval_cycle.rb
) with the new types:ApprovalCycle.configure do |config|
config.approval_cycle_setup_types = {
dummy_request: 0,
new_type: 1 # Add your new type here with the next integer
}
end
rails generate approval_cycle:setup_types --status
rails generate approval_cycle:setup_types
rails db:migrate
Note: The ApprovalCycle::Approvable
concern will be automatically added to your new model when you run the generator.
rails generate approval_cycle:install
- Creates the initializer file and copies migrationsrails generate approval_cycle:setup_types --status
- Shows which approval cycle columns are missing for configured typesrails generate approval_cycle:setup_types
- Generates migration to add missing approval cycle columns to your configured models and automatically adds ApprovalCycle::Approvable
concern to the model filesFAQs
Unknown package
We found that approval_cycle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.