Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5 Support Potential Solutions #205

Closed
blimmer opened this issue Mar 9, 2018 · 8 comments
Closed

Rails 5 Support Potential Solutions #205

blimmer opened this issue Mar 9, 2018 · 8 comments

Comments

@blimmer
Copy link

blimmer commented Mar 9, 2018

I'm opening this issue in an attempt to brainstorm some options for people who are looking to upgrade to Rails 5 and use this gem.

Rewrite Persistence

The readme recommends this:

https://github.com/geekq/workflow#custom-workflow-state-persistence

Fork with Rails 5 Patches

The @spreemo patch seems to have a few patches for the use cases they ran into:

master...spreemo:master

More Major Rewrite

This seems to have yet more integration with ActiveRecord:

https://tylergannon.github.io/rails-workflow

It might be scarier to move into this gem because of the larger rewrite

More?

If anyone else has successfully upgraded to Rails 5 with this gem, please feel free to add comments here. Perhaps we can gather the list of problems and come up with a solution that can be merged into this main project (see also #177 )

@kingdonb
Copy link

I am mulling over a Rails 5 upgrade and we use the workflow gem with Rails 4. I did not realize it might be a problem to upgrade to Rails 5 because of this gem, which appears to be (at least relatively?) unmaintained

I will let you know how it goes. It's interesting that this project hasn't had a release since 2014, but there are apparently features in the master branch such as the particular implementation of https://github.com/geekq/workflow#conditional-event-transitions described in the README (you cannot use a method symbol name as described in #183 but this apparently is supported in master, based on some work that was merged since v1.2.0)

Is there anyone still merging PRs on this gem? Need for volunteers?

@duffyjp
Copy link

duffyjp commented Mar 19, 2018

I'm still using stock workflow with a large Rails 5.0.6 project. I'm not doing anything terribly fancy, but it's still working fine for me. I guess I don't run into the specific cases causing problems. My git log shows we added Workflow in January 2012. Would have been Rails 3.x back then.

Another app I converted over to AASM. I like the way states & events are setup in workflow a lot better though.

@yebyen
Copy link

yebyen commented Apr 23, 2018

I've spoken with other people (this past week at RailsConf 2018) who are of the opinion that "geekq/workflow is not abandoned it's just finished" as in, doesn't have any bugs left in it

I don't know if that's true, but I've never used AASM and nobody who knows anything seems to be suggesting to move away from this gem

@svoop
Copy link

svoop commented Apr 30, 2018

I've switched to gem 'workflow', github: 'caseyprovost/workflow', branch: 'chores/rails-5.0' for now which works fine.

"(...) it's just finished" as in, doesn't have any bugs left in it

I don't quite agree. Most people use workflow in the context of Rails and as of current Master, geekq/workflow is broken on Rails 5 and up. The corresponding note in the README is no fix, just a mere hint at how factoring out the persistence code would be a fix.

I'm still having hope though that either @geekq can implement this and/or passes the gem (I mean the authoritative release from rubygems.org) to someone else who will. Otherwise, I'll have to switch to AASM despite the headache this may cause.

@geekq
Copy link
Owner

geekq commented May 4, 2018

it's just finished" as in, doesn't have any bugs left in it

The core of workflow (implementation for state transitions DSL) is stable and has worked for years, as it is now. There is also a stable interface to implement persistence, e.g. for ActiveRecord in Rails or others.

Since Rails internal interfaces / implementation change frequently, the integration with Rails is hard to implement in a non fragile way. Also a huge if ACTIVE_RECORD_VERSION == '3' elsif ACTIVE_RECORD_VERSION == '4' ACTIVE_RECORD_VERSION == '5' ACTIVE_RECORD_VERSION == '5.1' is hard to maintain / to back up with continuous integration.

Since I am not using Rails 5.x, I have not implemented any integration with it.

Since I do not know, how well the different workflow forks for Rails 5 support Rails 4.x, 3.x and 2.x I can not recommend any. Thanks to all people providing links/references (see comments above) to forks supporting Rails 5.x!

What I failed to do so far is:

  • to clearly separate the long living workflow core from Rails-integration-moving-target
  • to clearly document this decision
  • to provide at least experimental Rails 5.1 integration in a separate gem

... will do. Disclaimer: on a best effort basis ;-)

@dennyluan
Copy link

dennyluan commented Sep 1, 2018

Any updates on the branch that was proposed re: tests for Rails 5 support?

Thanks for supporting the improvements of this gem!

Just wanted to report that I'm currently also using this in Rails 5.0.7 after upgrading from 4.2. So far, things seem to be working fine.

@svoop
Copy link

svoop commented Nov 12, 2018

For those looking for alternatives other than AASM, the finite_machine gem has just awakened from a two years hibernation.

@geekq
Copy link
Owner

geekq commented Jan 12, 2019

Yeah! workflow awakened from hibernation too!

Workflow 2.0 released!

Please try it out with your application! If it is a Rails application, please use
https://rubygems.org/gems/workflow-activerecord/versions/4.1.2
Instructions, how to use, are at
https://github.com/geekq/workflow-activerecord#workflow-activerecord

Please report any bugs as a new issue for the relevant of both libraries:

Note for contributors: looks like github closed all the pull requests after I had changed the default branch on 2019-01-12. Please check the new refactored workflow 2.0, complementing workflow-activerecord and recreate your pull request if needed.

@geekq geekq closed this as completed Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants