Đây là những gì tôi có:rails state_machine: Làm cách nào để kích hoạt một hành động trên: trạng thái ban đầu?
state_machine :state, :initial => :open do
after_transition :on => :buy, :do => :send_buy_notification_email
after_transition :on => :take, :do => :send_take_notification_email
after_transition :on => :accept, :do => :send_accept_notification_email
after_transition :on => :cancel, :do => :send_cancel_notification_email
Bây giờ tôi muốn kích hoạt: send_trade_notification_email về tình trạng ban đầu mở.
Tôi làm như thế nào?
Chúc mừng,
Joel
Có điều đó có ý nghĩa. Tôi sẽ cố gắng làm điều đó! Thx – zabumba
Điều này có nghĩa là 'after_transition' có thể áp dụng cho': create' và ': update' không? – lulalala