Rails integration of DeepState.
class Cat < ApplicationRecord
include DeepState::Rails
use_deep_state_machine LifeOfACat, column: :state, as: :life, with: {}
end
will add a LifeOfACat
state machine to any instance of Cat
using the state
column to store the state.
Adds model
and cat
to the state machine context.
See DeepState for more details on how to specify a state machine
Add this line to your application's Gemfile:
gem 'deepstate-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install deepstate-rails
The gem is available as open source under the terms of the MIT License.