Sha256: b651ccafb5b0e9df3c2450d7211818f0a3bd7ab59056c12ef806d8bc88004bf4

Contents?: true

Size: 559 Bytes

Versions: 64

Compression:

Stored size: 559 Bytes

Contents

class User
  include DataMapper::Resource
  
  property :id, Serial
  property :name, String
  
  validates_present :name, :state, :access_state
  
  state_machine :initial => :unregistered do
    event :register do
      transition :unregistered => :registered
    end
    
    event :unregister do
      transition :registered => :unregistered
    end
  end
  
  state_machine :access_state, :initial => :enabled do
    event :enable do
      transition all => :enabled
    end
    
    event :disable do
      transition all => :disabled
    end
  end
end

Version data entries

64 entries across 64 versions & 15 rubygems

Version Path
state_machine-1.0.3 examples/merb-rest/model.rb
hsume2-state_machine-1.0.5 examples/merb-rest/model.rb
state_machine-1.0.2 examples/merb-rest/model.rb
hsume2-state_machine-1.0.4 examples/merb-rest/model.rb
hsume2-state_machine-1.0.3 examples/merb-rest/model.rb
hsume2-state_machine-1.0.2 examples/merb-rest/model.rb
hsume2-state_machine-1.0.1 examples/merb-rest/model.rb
state_machine-1.0.1 examples/merb-rest/model.rb
state_machine-1.0.0 examples/merb-rest/model.rb
state_machine-0.10.4 examples/merb-rest/model.rb
state_machine-0.10.3 examples/merb-rest/model.rb
state_machine-0.10.2 examples/merb-rest/model.rb
state_machine-0.10.1 examples/merb-rest/model.rb
state_machine-0.10.0 examples/merb-rest/model.rb
verborghs-state_machine-0.9.6 examples/merb-rest/model.rb
verborghs-state_machine-0.9.5 examples/merb-rest/model.rb
verborghs-state_machine-0.9.4 examples/merb-rest/model.rb
state_machine-0.9.4 examples/merb-rest/model.rb
branston-0.6.1 lib/branston/vendor/plugins/state_machine/examples/merb-rest/model.rb
state_machine-0.9.3 examples/merb-rest/model.rb