Adding an after transition in a class eval

31 views
Skip to first unread message

Steven Barragan

unread,
Nov 15, 2013, 7:24:24 PM11/15/13
to pluginaw...@googlegroups.com
Hi everyone, I'm working with spree gem, it has defined a payment as a state machine, I would like to add an after transition to the state machine already defined, I already tried this

Spree::Payment.class_eval do
  state_machine do
    before_transition to: "complete" do |payment|
    ...
  end
end

Spree::Payment.class_eval do
  state_machine do
    state_machine.before_transition :to => "complete" do |payment|
    ...
  end
end

But any of this works, could please some one help me??

Thanks in advance
Reply all
Reply to author
Forward
0 new messages