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

  • Home
  • SEARCH
  • 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 8487685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:19:05+00:00 2026-06-10T21:19:05+00:00

I am looking to implement a state machine in one of my models, and

  • 0

I am looking to implement a state machine in one of my models, and I have been considering the state_machine gem which seems popular and appears to have a nice, simple API.

Anyways, it seems like there is no concept of persisting the state of the model, since the documentation does not illustrate any way to map the state to a DB property using ActiveRecord or any other supported ORM. I would expect to load an object from the DB, check its state if desired, and based on its state allow certain events/transitions to take place.

  • Am I completely missing something here or is there no way to persist the current state?
  • If not, how can a transient state useful for any persisted model whose state changes over long periods of time?
  • Should I be used a different plugin, something more suited for workflows?
  • 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-10T21:19:06+00:00Added an answer on June 10, 2026 at 9:19 pm

    As far as the documentation goes, the state machine library works with any attribute, either one that’s created with attr_accessor, an @-instance variable, or a database column. It does seem to be your responsibility to call save on the record if any changes have been made, though.

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

Sidebar

Related Questions

I have been looking to implement a custom class of : IList<ArraySegment<byte>> this will
I've used the State pattern to implement a simple finite state machine. Looking at
I am looking to implement some throttling behavior into one of my viewmodels. It's
I'm looking to implement the jQuery UI so that the slider bar fills one
Basically I have a custom implemented finite state machine that mostly listens for hardware
I have a (somewhat) large truth table / state machine that I need to
I have been, exhaustively, looking at examples of WF4 and am not sure it
I have a list of entities which implement an ICollidable interface. This interface is
Looking to implement a RIA (rich internet application) either as a java (JWS) application
I'm looking to implement a warning if the user attempts to leave the order

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.