Commit Graph

13 Commits

Author SHA1 Message Date
Norman Clarke bf7ff4c44a
Cast string to symbol in fire/fire!, and fix deceptive error class and message (#788)
* Cast string to sym when checking event in `fire`

* Return early from method if event found

* Change message to reference Event, not State

* Add UndefinedEvent exception

Previously the code raised "UndefinedState" when it failed to find an
Event. This is confusing but was already released to the public. So this
adds UndefinedEvent as a subclass of UndefinedState and raises it
instead.

* Update Changelog
2022-07-27 15:28:17 +05:30
Ahmed AbdelHalim 7bdf3eacd2 Update the attr_reader to match the convention 2019-01-03 20:58:53 +05:30
Ahmed AbdelHalim cfb5479a8d Update InvalidTransition to include state_machine_name
For easier debugging and error handling for models with multiple state_machines.
This non-breaking change add the state_machine name to the attributes of the InvalidTransition error
2019-01-03 20:58:53 +05:30
Oleksandr Avoyants 5e29fe5de4 Remove trailing space from error message 2017-08-16 13:47:24 +03:00
Egor Lynko 6d6bcf8471 Make errors more inspectable by settings message
When message is set as variable, instead of redefining `message`
method, the message will be used in `inspect` and `to_s` calls,
both implicit and explicit, which improves logs readability and
simmplifies debugging in the irb
2017-07-26 12:53:33 +05:30
Phil Pirozhkov b891895617 Eager error message 2016-03-15 22:59:35 +03:00
Chris Woodrich 134129ee82 Restructure error sentence per @alto suggestion
Fix failing spec by adding period
Use upstream version of Proc handling
Fix spacing
Restart travis
2016-01-10 17:00:24 -08:00
Chris Woodrich b6d5a0d7fa Add failed callback(s) into InvalidTransition exception 2015-10-22 01:23:04 -07:00
Thorsten Böttger d540ca8761 handle edge cases when a state machine is accessed which doesn't exist 2015-08-05 22:00:22 +12:00
Thorsten Böttger cf7ac74664 make sure to use parameterised aasm everywhere 2015-05-26 21:29:17 +12:00
Luke Roberts 5a8454221f reference state machine object and event in invalid transition error so end user can intelligently handle 2015-03-01 20:08:45 -08:00
Thorsten Böttger 163859caef may configure to not allow direct assignment for persisted AASM models #53 2014-05-18 14:21:35 +02:00
Thorsten Böttger 1187512243 errors now have their own file 2011-11-26 18:55:50 +01:00