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