state-machines / state_machines-activerecord

StateMachines Active Record Integration
https://github.com/state-machines/state_machines-activerecord
MIT License
401 stars 83 forks source link

rails 6 support #84

Closed optimum-dulopin closed 5 years ago

optimum-dulopin commented 5 years ago

seems to be an issue with rails 6 when I do bundle update, here what I get

Using state_machines-activerecord 0.0.0 (was 0.6.0)

rbq commented 5 years ago

I wonder if there is a reason for 0.0.0 to exist. An error would probably be more useful than accidentally pulling in a version without functionality.

yuriihabrusiev commented 5 years ago

I got the same issue. Here are details:

    rails (~> 6.0.0) was resolved to 6.0.0, which depends on
      activemodel (= 6.0.0)

    state_machines-activerecord (~> 0.6.0) was resolved to 0.6.0, which depends on
      state_machines-activemodel (>= 0.5.0) was resolved to 0.5.0, which depends on
        activemodel (< 5.2, >= 4.1)

The thing is, state_machines-activerecord worked well with rails-6.0.0.rc1

sunny commented 5 years ago

This has been fixed in https://github.com/state-machines/state_machines-activemodel/pull/18.

Until a new version of state_machines-activemodel is released, a workaround is to add the following lines to your Gemfile:

# Dependency for state_machines-activerecord
# Added here to support Rails 6, until a new version is released.
# https://github.com/state-machines/state_machines-activerecord/issues/84
gem "state_machines-activemodel",
    github: "state-machines/state_machines-activemodel"
seuros commented 5 years ago

I'm releasing a state_machines-activemodel version that works with activemodel 6.x in few minutes.

seuros commented 5 years ago

@rbq https://rubygems.org/gems/state_machines-activerecord/versions/0.0.0 is yanked now.

rbq commented 5 years ago

@seuros Thanks a lot! :)