Comments (8)
Где были мои глаза?
Володя, спасибо!
from workflow.
You are right: to use the latest workflow
gem in version 2 or later, all persistence libraries, e.g. workflow-sequel
need to be updated.
- You can provide a fix to
workflow-sequel
(they have instructions on Contributing)
or implement your own persistence as described in
https://github.com/geekq/workflow#custom-workflow-state-persistence - You can try using older version of
workflow
. It is still available in github and via rubygems. Please read https://github.com/geekq/workflow#state-persistence-with-activerecord
from workflow.
Владимир, but the bug that I opened is about that persistence with sequel, exactly as described in docs does not works. And I can't get why.
from workflow.
-
UniqueViolation... Ключ "(id)=(2)" уже существует
looks like a record with the same id already exists. Does error happens directly onSequelbag.create
? Is it supposed to save the record immediately?persist_workflow_state
should not cause this since it is not called for new records but only inprocess_event!
https://github.com/geekq/workflow/blob/develop/lib/workflow.rb#L97-L125 -
Can you please provide a complete minimal application (if it is a Rails-Application) or even a self-contained single-file script demonstrating the problem + Gemfile so I can easily reproduce?
from workflow.
Yes, and this appears when updating exisiting record and only when the class contains include Workflow
. I will make the script soon.
from workflow.
https://github.com/deemytch/workflow-sequel-bag
Edit createdb.sql and sequelbag.rb if you need to change user/password/database.
Run main.sh there.
from workflow.
👍 was able to reproduce.
Now try to change state name from :new
to something else like :neww
and see what happens!
from workflow.
Background: if you define some workflow states and events, a bunch of convinience methods are created behind the scene. Looks like one of them collides with the methods used by the Sequel::Model implementation - likely new?
How I debugged:
- run your script - can reproduce the problem
- commented out actions in persitence callbacks like
persist_workflow_state
,before_validation
etc. Problem was still there. - removed everything workflow-related - problem diappeared
- added
include Workflow
- still works - added workflow_column and an empty
workflow do
block - still works - added states one by one starting with the last one - only the
:new
state had a problem - rename the state
I should probably mention it in the documentation.
from workflow.
Related Issues (20)
- Rails 5 Support Potential Solutions HOT 8
- Gem still maintained? HOT 1
- Specify different callback method HOT 1
- Improve code coverage HOT 1
- Workflow table not updated with workflow state HOT 3
- Could not load the ruby-graphiz or active_support gems for rendering: cannot load such file -- ruby-graphviz HOT 4
- "advanced end to end example" does not exist at given link HOT 1
- active_admin-workflow | Active Admin for workflow gem HOT 1
- Ensure tested example code in readme
- -- HOT 1
- Rake task to draw diagram as Railtie? HOT 1
- GPL licensed dependency `ruby-graphviz` HOT 3
- Workflow::NoTransitionAllowed error, but event is defined for the state HOT 2
- Port CI from travis-CI to GitHub actions
- Callback on entering initial state HOT 1
- How to change workflow names after the fact?
- Dynamic runtime/user defined workflows HOT 1
- Error Drawing Workflow diagram with meta variables
- previous state? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workflow.