0

My event is defined this way:

event :share, after: :inc_in_path_share do
      transitions from: :bucketed, to: :shared
      error do |e|
        inc_share(message, tags)
      end
    end

and I call it my_instance.share(message, tags). If the transition is allowed, I don't have problem to call inc_in_path_share with message and tags. But when the transition is not allowed, I want to have a default action processed by inc_share in my error block.

How to pass message and tags to the error block ? May be the way I am thinking it is not the best too (XY problem). Thanks !

yutu
  • 109
  • 1
  • 5

1 Answers1

0

Jonathan Pares created a ticket for this on AASM's github page (see https://github.com/aasm/aasm/issues/196). I (maintainer of AASM) will implement this feature.

alto
  • 609
  • 4
  • 8