Sha256: d3584705d83ad358d0925d3cdac027c739d90a3c8f28ab1cf0b14fe1cce39490

Contents?: true

Size: 708 Bytes

Versions: 21

Compression:

Stored size: 708 Bytes

Contents

class SwitchObserver < ActiveRecord::Observer
  cattr_accessor :notifications
  self.notifications = []
  
  def before_turn_on(switch, from_state, to_state)
    notifications << ['before_turn_on', switch, from_state, to_state]
  end
  
  def after_turn_on(switch, from_state, to_state)
    notifications << ['after_turn_on', switch, from_state, to_state]
  end
  
  def before_transition(switch, attribute, event, from_state, to_state)
    notifications << ['before_transition', switch, attribute, event, from_state, to_state]
  end
  
  def after_transition(switch, attribute, event, from_state, to_state)
    notifications << ['after_transition', switch, attribute, event, from_state, to_state]
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
spree-enriquez-0.9.4 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.9.4 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.9.3 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.9.2 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.9.1 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.9.0 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.8.4 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.8.5 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.4.0 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.4.1 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.5.0 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.6.0 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.5.1 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.7.1 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.7.0 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.8.0 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.8.1 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.8.2 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
spree-0.8.3 vendor/plugins/state_machine/test/app_root/app/models/switch_observer.rb
state_machine-0.3.1 test/app_root/app/models/switch_observer.rb