Sha256: e44de36b95f77704561f13ec2e03c1325ac5095f405357223792c7c6175482e5

Contents?: true

Size: 830 Bytes

Versions: 5

Compression:

Stored size: 830 Bytes

Contents

class StateMonitor < ActiveRecord::Observer
  observe :order, :shipment

  # Generic transition callback *after* the transition is performed
  def after_transition(object, transition)

    # current_user_session = Session.activated? ? Session.find : nil
    #
    # if current_user_session
    #   author = current_user_session.user
    # elsif object.respond_to?(:user)
    #   author = object.user
    # end
    #
    # to_state = transition.attributes[:to_name]
    # object.state_events.create({
    #   :previous_state => transition.attributes[:from],
    #   :name           => transition.attributes[:event].to_s,
    #   :user_id        => author && author.id
    #   })
    #
    # ActiveRecord::Base.logger.info("#{object.class}##{object.id}: #{transition.attributes[:from]} => #{transition.attributes[:to]}")
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_core-0.40.4 app/models/state_monitor.rb
spree_core-0.40.3 app/models/state_monitor.rb
spree_core-0.40.2 app/models/state_monitor.rb
spree_core-0.40.1 app/models/state_monitor.rb
spree_core-0.40.0 app/models/state_monitor.rb