Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

before_transition works, after_transition fails on Rails 4/Mongoid #277

Open
nofxx opened this Issue · 18 comments
@nofxx

Lost some time on this one... only here?
As 'fails' I mean wont run, tryed some raise() there and nothing happens.

class Order
  include Mongoid::Document

  state_machine :state, :initial => :created do

    before_transition :on => :pay do |o|
    #... WORKS!

    after_transition :on => :pay do |o|
    # ... NOTHING

  end
end

Rails 4, Mongoid 4

@aganov

+1 Anyone got any idea how to quick fix this?

@tagrudev

+1

@aganov

Somehow this commit is breaking the after_transition callback mongoid/mongoid@8c23304

@we4tech

hi @aganov is it still pending pull request ? I just stucked with the same issue. after_transition doesn't fire up. Can we get it merged ?

@Erol

@aganov @pluginaweek Any chance that this will get merged soon?

@thijsc

Also ran into this bug, would be great to get a fix merged.

@thijsc

@aganov @pluginaweek Is there any way I can help getting this fixed?

@thijsc

@aganov I've confirmed that that fix works, but the pull is probably not mergable yet since there's no test for the fix. I'd be happy to see if I can help with that?

@momelnyk

+1 for tests and merge

@thijsc

If somebody creates a good pull request for this, will it get merged? Mongoid 4 release is getting pretty close and it would be good to have this in an official release.

cc @aganov @pluginaweek

@yudho

I could reproduce the same behavior. Before transition is working, while after is not called. Really appreciate for the fix.

@blakefrost blakefrost referenced this issue from a commit in blakefrost/newstime
@blakefrost blakefrost Implement full cycle compile with real time update
State machine after_transition hook with mongoid was not working. Issue is
documented here pluginaweek/state_machine#277

Used the version of state_machine from
https://github.com/aganov/state_machine/tree/88e45a1b1622d7748933bc941e7e9b08b3045a94,
referenced in the github issue, to get things working for the time being.

I'm using the transtion to trigger the broadcast of the update to the compiled
version.
dc74738
@localredhead

+1 please

@helmerj

+1

@gemtainers

Have an idea about mainaining #331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.