Sha256: 12bc6a38c211ebc36b543ef40b01abc60603d0c2f8e6afc8bbf267a28576163e

Contents?: true

Size: 614 Bytes

Versions: 22

Compression:

Stored size: 614 Bytes

Contents

class Switch < ActiveRecord::Base
  # Tracks the callbacks that were invoked
  attr_reader :callbacks
  
  # Dynamic sets the initial state
  attr_accessor :initial_state
  
  # Whether or not validations should fail
  attr_accessor :fail_validation
  validate Proc.new {|switch| switch.errors.add_to_base 'is invalid' if switch.fail_validation}
  
  # Whether or not saves should fail
  attr_accessor :fail_save
  before_save Proc.new {|switch| !switch.fail_save}
  
  # Arbitrary data associated with the switch
  attr_accessor :data
  
  def initialize(attributes = nil)
    @callbacks = []
    super
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

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