app/models/order_observer.rb
# Generic transition callback *after* the transition is performed
Generic transition callback *after* the transition is performed
Generic transition callback * after * the transition is performed
def after_transition(record, attribute_name, event_name, from_state, to_state)
    current_user_session = UserSession.activated? ? UserSession.find : nil
    author = current_user_session ? current_user_session.user : record.user
    record.state_events.create({
        :previous_state => from_state,
        :name           => event_name,
        :user_id        => author && author.id 
      })
    ActiveRecord::Base.logger.info("Order##{record.id}: #{from_state} => #{to_state}")
  end
def after_transition ( record , attribute_name , event_name , from_state , to_state ) current_user_session = UserSession . activated? ? UserSession . find : nil author = current_user_session ? current_user_session . user : record . user record . state_events . create ( { :previous_state => from_state , :name => event_name , :user_id => author && author . id } ) ActiveRecord :: Base . logger . info ( "Order##{record.id}: #{from_state} => #{to_state}" ) end
Generic transition callback *after* the transition is performed
Generic transition callback * after * the transition is performed
record
<not_specific>
attribute_name
<not_specific>
event_name
<not_specific>
from_state
<not_specific>
to_state
<not_specific>