Sha256: 501e2a0ce023f3d806b4eb016b6f2fd0ecd45599651dbc0ea205aa8702706f8a

Contents?: true

Size: 422 Bytes

Versions: 25

Compression:

Stored size: 422 Bytes

Contents

# An invalid example.
class InvalidTransitions2
  include DataMapper::Resource

  property :id, Serial

  is :state_machine do
    state :happy
    state :sad

    event :toggle
  end

  # The next lines are intentionally incorrect.
  #
  # 'transition' is only valid when nested beneath 'event'
  transition :to => :happy, :from => :sad
  transition :to => :sad,   :from => :happy

end

InvalidTransitions2.auto_migrate!

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
dm-is-state_machine-0.9.11 spec/examples/invalid_transitions_2.rb
dm-is-state_machine-0.9.10 spec/examples/invalid_transitions_2.rb
dm-is-state_machine-0.9.5 spec/examples/invalid_transitions_2.rb
dm-is-state_machine-0.9.8 spec/examples/invalid_transitions_2.rb
dm-is-state_machine-0.9.9 spec/examples/invalid_transitions_2.rb