Comments (9)
@seuros this is a show stopper for me. I'm happy to dig in and fix it but need to be pointed in the right direction. Perhaps a usage error, or documentation needs updated?
I've traced it back further to Integrations
. @integrations
is an empty array so I'm assuming that I've misconfigured or this module is not registering itself. #register
is never called.
from state_machines-activerecord.
Thank you for your input.
#register
is in fact used in the integrations, for example : https://github.com/state-machines/state_machines-activerecord/blob/master/lib/state_machines/integrations/active_record.rb#L562
from state_machines-activerecord.
@seuros Found it! Simple problem but I think the readme needs updated:
require 'state_machines'
require 'state_machines-activerecord'
I didn't require it anywhere and expected auto-detection.
from state_machines-activerecord.
Bundler should require them by default.
Else you can require just 'state_machines-activerecord'
from state_machines-activerecord.
This may be due to the fact that these models are in a rails Engine.
from state_machines-activerecord.
If state_machines-activerecord is part of your Gemfile, it should work.
from state_machines-activerecord.
They are in the gemspec:
s.add_dependency 'state_machines'
s.add_dependency 'state_machines-activerecord
But still had to explicitly require them. Perhaps I'm missing a setting for the engine/gem?
from state_machines-activerecord.
I'm facing this exact issue in one of my project (with another gem), maybe it a bug in rails.
PS, you don't need to add state_machines as dependency too, state_machines-activerecord depend on state_machines-activemodel and state_machines.
from state_machines-activerecord.
Got it, thank you for the quick assistance.
from state_machines-activerecord.
Related Issues (20)
- Docs: Outdated rails code style
- doc on rubydoc, it's seems not working HOT 1
- After upgrading to 0.4.1 (which uses state machines 0.5.0) I can't start my app HOT 1
- scope used on search application
- All state validations firing during initial state HOT 1
- Add support for Rails 5.2
- Pick initial state from DB schema
- Parameter to transition HOT 1
- state_machines-activerecord 0.5.1 breaks attribute default with procs HOT 4
- defining associations in state block break HOT 3
- Scope doesn't select records with NULL state HOT 2
- Support for activerecord 6.0 and rails 6.0 HOT 3
- rails 6 support HOT 6
- undefined after_commit callback HOT 2
- State based method gives error on transition callbacks with syntax "after_transition <event/transition>, do: [:method]" HOT 2
- After transitions callback not working ? HOT 1
- New minor release for Ruby 2.7 fix HOT 7
- Statemachine observer is not working as expected. HOT 4
- Off-by-one after_transition bug, when using two state machines at the same time.
- Transient attributes quirks HOT 1
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 state_machines-activerecord.