AASM
AASM - State machines for Ruby classes (plain Ruby, ActiveRecord, Mongoid, NoBrainer, Dynamoid) (by aasm)
state_machines
Adds support for creating state machines for attributes on any Ruby class (by state-machines)
Our great sponsors
AASM | state_machines | |
---|---|---|
3 | 5 | |
4,948 | 795 | |
0.6% | 1.4% | |
4.4 | 3.3 | |
about 2 months ago | 6 days ago | |
Ruby | Ruby | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
AASM
Posts with mentions or reviews of AASM.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-03-21.
-
Code review of an Order object implemented as a state machine
AASM gem is great too! Easy to use and actively maintained.
-
RoR Gems: Pin To Plane For Developing RoR Application
6. AASM
-
Validate state transition easily without any gem
You can use state machine gems, such as aasm to write validation. But the gem introduces new DSL to write state transition. It's too much just for validation.
state_machines
Posts with mentions or reviews of state_machines.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-01-21.
- Gem adds support for creating state machines for attributes on any Ruby class
-
Practical State Machinery
State Machines (Ruby) - A popular library providing a Ruby DSL for easily building finite state machines
-
Why Developers Never Use State Machines (2011)
As a regular user of the state_machine Ruby gem, I wouldn't recommend it. If you don't believe me, just check out the "Class definition" section of the usage examples: https://github.com/state-machines/state_machines#usage
The problems are obvious. It's built on magic and indirection. This leads to difficult to debug state machine problems. For anything beyond simple state machines you quickly lose any idea of what your object is doing.
-
ActiveRecord: Adding Boolean methods for DateTime columns
Might this be better handled with a state machine with active record integration?
-
Ruby 3 Released
Here's an example of how it can happen - look at the code examples in https://github.com/state-machines/state_machines - almost everything you are coding is in the DSL of that library if you are using it:
What are some alternatives?
When comparing AASM and state_machines you can also consider the following projects:
State Machine - Adds support for creating state machines for attributes on any Ruby class
Workflow - Ruby finite-state-machine-inspired API for modeling workflow
Statesman - A statesmanlike state machine library.
simple_states - A super-slim statemachine-like support library
StatefulEnum - A very simple state machine plugin built on top of ActiveRecord::Enum
state_shifter
transitions - State machine extracted from ActiveModel
FiniteMachine - A minimal finite state machine with a straightforward syntax.
AASM vs State Machine
state_machines vs State Machine
AASM vs Workflow
state_machines vs Statesman
AASM vs Statesman
state_machines vs simple_states
AASM vs StatefulEnum
state_machines vs state_shifter
AASM vs transitions
state_machines vs transitions
AASM vs FiniteMachine
state_machines vs FiniteMachine