use active_model to avoid invoke ActiveRecord
Using a lambda as event success callback, add ruby-debug, fix event_failed callback.
This reverts commit f3615d3.
This uncovered some bug not firering the event_failed callback in any case of an exception has been raised. This is now handled. The exception is just re-raised if the record doesn't have defined a event_failed callback. If he had it is up to the implementation to handle the execption. We are just return false.
Internally the callback will now always be a lambda to simplify the implementation on the caller site
This prevents failing tests when tests are executed in an unpredictable order. Furthermore I think all AR-related tests should stand together including the required migrations.
* 'master' of https://github.com/troessner/transitions: Update README. Bump version. Make auto generation of AR scopes configurable and raise an exception in case we would override an existing method. Fix specs - we need to run migrations before calling `state_machine`.
… in case we would override an existing method.
* 'master' of https://github.com/troessner/transitions: added test for event_fired_callback
add event name to event_fired_callback
If event_fired is defined on record, the current state, the new state and the event is passed. This test checks if everything is passed to the callback properly.
* https://github.com/troessner/transitions: (26 commits) Ignore Rubymine. Fix homepage in gemspec. Revert "Refactor." Refactor. Update README.rdoc Update README.rdoc Add travis config. Update README.rdoc Update README.rdoc Add rvmrc. Bump version. replaced class_eval with define_method in transitions#define_state_query_method added .rvmrc to .gitignore changed one timestamp value in tests to string to ensure wider test coverage updated README Added tests for timestamp and satisfied tests cleaned up test DB code Added .rvmrc file Added comment for reload method Stringify state name AR prefixes the state with the table name (i.e. "`traffic_lights`.`state` = `traffic_lights`.`red`") if we pass the name as symbol. We need to pass it as string, so that it works ("`traffic_lights`.`state` = 'red'") ...
* 'master' of https://github.com/tisba/transitions: add event name to the event_fired_callback