Class: Oujoke::Workflow::RevokeTransition

Inherits:
Transition
  • Object
show all
Defined in:
lib/workflow/transitions/revoke_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

#initialize

Constructor Details

This class inherits a constructor from Oujoke::Workflow::Transition

Instance Method Details

#performObject



5
6
7
8
9
10
11
12
# File 'lib/workflow/transitions/revoke_transition.rb', line 5

def perform
  @bill = Bill.find(@workflow.bill_id)
  @bill.revoke
  @bill.events.create(:message =>"#{@bill.sender} отозвал счет") 
  @bill.comments.create(:body => @params["comment"],:base_contact => @workflow.initiator_email) unless @params["comment"].blank?
  Notifier.deliver_revoke_bill(:bill => @bill , :comment => @params["comment"])
  @workflow.current_state = @params["to_state"]
end