Thanks Michael! :)

I screwed around with the idea some more this afternoon and came up with 
https://gist.github.com/3051916, but it's calling payment_required? on what 
appears to be the state machine's anonymous class rather than the order. I 
don't know quite how to fix this.

There's a Stack Overflow question now open for this too: 
http://stackoverflow.com/questions/11339333/defining-a-custom-state-machine. 


On Thursday, 5 July 2012 at 3:20 PM, Michael Gall wrote:

> At the risk of being an annoying +1er. I think this is probably the most 
> annoying thing about stuff that's supposed to be extensible and uses state 
> machine - Spree in particular. 
> 
> I applaud you.
> 
> On Thu, Jul 5, 2012 at 2:23 PM, Ryan Bigg <[email protected] 
> (mailto:[email protected])> wrote:
> > I'm attempting to improve Spree's state machine by allowing people to add / 
> > remove steps to and from it. I figured there's enough smart people on this 
> > list that somebody may have an idea of how to do this. 
> > 
> > Our current state machine is here: 
> > https://github.com/spree/spree/blob/1-1-stable/core/app/models/spree/order.rb#L52-99
> >  
> > 
> > What I'd like to do is to be able to remove any step from the list of 
> > transitions inside the next event, and add others in there as well. Then I 
> > want a list of the states *in between* "cart" and "complete" can go through 
> > so that we can show this on the order page.  
> > 
> > I've spent a lot of time (https://github.com/spree/spree/pull/1418/files 
> > and https://github.com/spree/spree/pull/1733, plus other things), and I 
> > really don't know how to do this.  
> > 
> > So who would like to take this wonderfully presented opportunity to prove 
> > themselves smarter than me? 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Ruby or Rails Oceania" group.
> > To post to this group, send email to [email protected] 
> > (mailto:[email protected]).
> > To unsubscribe from this group, send email to 
> > [email protected] 
> > (mailto:rails-oceania%[email protected]).
> > For more options, visit this group at 
> > http://groups.google.com/group/rails-oceania?hl=en.
> 
> 
> 
> -- 
> Checkout my new website: http://myachinghead.net
> http://wakeless.net
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected] 
> (mailto:[email protected]).
> To unsubscribe from this group, send email to 
> [email protected] 
> (mailto:[email protected]).
> For more options, visit this group at 
> http://groups.google.com/group/rails-oceania?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to