Giter Site home page Giter Site logo

Comments (9)

rosskevin avatar rosskevin commented on May 18, 2024

@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.

seuros avatar seuros commented on May 18, 2024

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.

rosskevin avatar rosskevin commented on May 18, 2024

@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.

seuros avatar seuros commented on May 18, 2024

Bundler should require them by default.
Else you can require just 'state_machines-activerecord'

from state_machines-activerecord.

rosskevin avatar rosskevin commented on May 18, 2024

This may be due to the fact that these models are in a rails Engine.

from state_machines-activerecord.

seuros avatar seuros commented on May 18, 2024

If state_machines-activerecord is part of your Gemfile, it should work.

from state_machines-activerecord.

rosskevin avatar rosskevin commented on May 18, 2024

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.

seuros avatar seuros commented on May 18, 2024

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.

rosskevin avatar rosskevin commented on May 18, 2024

Got it, thank you for the quick assistance.

from state_machines-activerecord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.