Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AASM: Transitions from any state?

I am using AASM. Is it possible to transition from any state? For example:

aasm_event :publish do   transitions :to => :publish, :from => ANY_STATE end 

I know that it is possible to pass an array of states to :from, but this isn't what I'm after. I have tried omitting the :from completely, but that didn't work.

like image 469
gjb Avatar asked Feb 06 '11 09:02

gjb


1 Answers

aasm now supports transitions without any from specified, which will allow transitioning from any state.

aasm_event :publish do   transitions to: :publish # from ANY end 

(bragging rights: I added this feature because I needed it)

like image 55
swrobel Avatar answered Oct 09 '22 23:10

swrobel