Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nofxx opened this issue Aug 27, 2013 · 24 comments
Closed

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

nofxx opened this issue Aug 27, 2013 · 24 comments

Comments

@nofxx
Copy link

nofxx commented Aug 27, 2013

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

@mensfeld
Copy link

+1

@aganov
Copy link

aganov commented Sep 4, 2013

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

@tagrudev
Copy link

tagrudev commented Sep 4, 2013

+1

@aganov
Copy link

aganov commented Sep 4, 2013

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

@we4tech
Copy link

we4tech commented Sep 29, 2013

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
Copy link

Erol commented Oct 12, 2013

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

@kylemacey
Copy link

+1

@thijsc
Copy link

thijsc commented Jan 15, 2014

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

@thijsc
Copy link

thijsc commented Jan 21, 2014

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

@thijsc
Copy link

thijsc commented Jan 21, 2014

@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
Copy link

+1 for tests and merge

@thijsc
Copy link

thijsc commented Mar 14, 2014

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
Copy link

yudho commented Apr 5, 2014

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

unicornrainbow added a commit to unicornrainbow/newstime that referenced this issue Apr 30, 2014
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.
@localredhead
Copy link

+1 please

@helmerj
Copy link

helmerj commented Sep 4, 2014

+1

1 similar comment
@max-konin
Copy link

+1

@gemtainers
Copy link

Have an idea about mainaining #331

@mvleo-github
Copy link

+1

@aganov
Copy link

aganov commented Oct 7, 2015

This repository isn't supported anymore... Consider using https://github.com/state-machines/state_machines-mongoid instead

@mensfeld
Copy link

mensfeld commented Oct 7, 2015

@aganov then maybe you should mark it in readme as open for adoption

@nofxx
Copy link
Author

nofxx commented Oct 7, 2015

Thanks @aganov. Also, another option is 'AASM'.

@nofxx nofxx closed this as completed Oct 7, 2015
@aganov
Copy link

aganov commented Oct 7, 2015

@mensfeld I'm not the author of this gem, latest commit is from May 7, 2013
@nofxx yes AASM is good too, but state-machines/state_machines-mongoid is a drop in replacement...

@mensfeld
Copy link

mensfeld commented Oct 7, 2015

@aganov true - sorry
@obrie - my question is for you then I assume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests