Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8625157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:42:46+00:00 2026-06-12T07:42:46+00:00

I need a state machine for a message private system and order status system.

  • 0

I need a state machine for a message private system and order status system.

you can see these two gems:

https://github.com/pluginaweek/state_machine

https://github.com/rubyist/aasm

Edited..

I’m using mongoid with mongodb database

What gem is most appropriate for this features?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:42:47+00:00Added an answer on June 12, 2026 at 7:42 am

    Update:

    Check out the recent RailsCast: A Tour of State Machines

    One thing to mention is that when you use a state machine, it may make it difficult to generate objects for tests which are in an invalid state..

    Previous Answer:

    Both gems are working great, are compatible with Mongoid, and are actively maintained.

    I’ve used AASM in the past, and it has been around a bit longer, but the state_machine gem has quite a bit more functionality and more options. e.g. check the methods generated by state_machine on the base class (below their example); you can define more details, e.g. transition callbacks, conditional transitions; you can do path analysis, there’s even a GraphViz generator to generate a nice picture of your state graph.

    If you need just a simple state machine, you can go with AASM. If you need to model more details like conditional transitions or transition callbacks, path analysis, do queries about the states a lot, or need nested state machines, then go for the state_machine gem.

    References:

    AASM : https://github.com/aasm/aasm

    state_machine : https://github.com/pluginaweek/state_machine

    Additional info about state_machine:

    http://www.pluginaweek.org/2009/03/08/state_machine-one-machine-to-rule-them-all/

    http://rdoc.info:8080/github/pluginaweek/state_machine/master/StateMachine/Machine

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to implement a finite-state-machine in order to keep track of a few
We have a system at my work that is basically a message-driven state machine.
I need to see if a custom posted event to the state machine was
For GUI purposes I need by current state of state machine to enumerate possible
I'm trying to implement Finite-State Machine in C and need it to be very
I'm new to C++. How can I implement a State Machine in C++? I'm
I am working a project where i need to create a state machine work
We need to implement a simple state machine in C . Is a standard
I have a Windows Workflow Foundation (3.0) state machine in which I need certain
I have a (somewhat) large truth table / state machine that I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.