benzelano / test_lh_import

1 stars 0 forks source link

state_events and namespace ? #144

Closed benzelano closed 13 years ago

benzelano commented 13 years ago

Thomas Darde opened this issue

I think the state_events helper is not generated when using multiple state_machines and the namespace feature. (only the main namespace is available)

original LH ticket

This ticket has 0 attachment(s).

benzelano commented 13 years ago

The :namespace option is only used for states and events (i.e. car_parked? for a "parked" state or can_park? for a "park" event). Methods like "state_events" are already namespaced by the name of the state machine. The prefix used here ("state") is based on the name of the machine. You can change the name of the machine to anything you want, but you’ll just need to explicitly set the attribute to write to via the :attribute option in the state_machine.