README.md in state_objects-0.9.0 vs README.md in state_objects-0.9.1
- old
+ new
@@ -27,11 +27,11 @@
$ gem install state_objects
## Usage
class WalkLights < ActiveRecord::Migration
- def self.change
+ def change
create_table :walk_lights do |t|
t.string :color_state, :default => LightRedState.db_value
end
end
@@ -56,11 +56,11 @@
state_objects :color_state,
LightGreenState,
LightRedState
state_object_events :color_state, :change
- scope :red, where(LightRedState.occurs )
- scope :green, where(LightGreenState.occurs )
+ scope :red, where(WalkLight.color_state_red_occurs )
+ scope :green, where(WalkLight.color_state_green_occurs )
end
# now lets use it
north_south_elm_300_block = WalkLight.create(color_state: LightRedState.db_value)
while (true)