Class: Oujoke::Workflow::RejectTransition
- Inherits:
-
Transition
- Object
- Transition
- Oujoke::Workflow::RejectTransition
- Defined in:
- lib/workflow/transitions/reject_transition.rb
Instance Attribute Summary
Attributes inherited from Transition
#from_state, #name, #on_raise, #params, #to_state, #workflow
Instance Method Summary collapse
Methods inherited from Transition
Constructor Details
This class inherits a constructor from Oujoke::Workflow::Transition
Instance Method Details
#perform ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/workflow/transitions/reject_transition.rb', line 5 def perform @bill = Bill.find(@workflow.bill_id) @bill.reject @bill.events.create(:message =>"#{@workflow.initiator_email} отказался оплачивать") @bill.comments.create(:body => @params["comment"],:base_contact => @workflow.initiator_email) unless @params["comment"].blank? Notifier.deliver_reject_bill(:bill => @bill , :comment => @params["comment"]) @workflow.current_state = @params["to_state"] end |