The project is in a healthy, maintained state
Tracks state transitions with AASM.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

Runtime

>= 7.0.4
 Project Readme

StateTransitions

Short description and motivation.

Usage

How to use my plugin.

Installation

Add this line to your application's Gemfile:

gem "state_transitions"

And then execute:

bundle

Install migrations:

rails state_transitions:install:migrations

Run migrations:

rails db:migrate

Include the module in a model:

class Project < ApplicationRecord
  include StateTransitions
end

Track current user on state transitions from requests:

class ApplicationController
  around_action :set_state_transitions_current

private

  def set_state_transitions_current
    StateTransitions::Current.user = current_user
    yield
  ensure
    StateTransitions::Current.user = nil
  end
end

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.