mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
typo fixes, and improved warning message
This commit is contained in:
parent
baf7c031ca
commit
a60dfefdc6
2 changed files with 6 additions and 6 deletions
|
@ -365,9 +365,9 @@ simple.aasm(:work).current
|
|||
|
||||
```
|
||||
|
||||
_AASM_ doesn't prohibit to define the same event in both state machines. The
|
||||
latest definition "wins" and overrides previous definitions. A warning is issued:
|
||||
`SimpleMultipleExample: The event name run is already used!`.
|
||||
_AASM_ doesn't prohibit to define the same event in more than one state machine. The
|
||||
latest definition "wins" and overrides previous definitions. Nonetheless, a warning is issued:
|
||||
`SimpleMultipleExample: The aasm event name run is already used!`.
|
||||
|
||||
All _AASM_ class- and instance-level `aasm` methods accept a state machine selector.
|
||||
So, for example, to use inspection on a class level, you have to use
|
||||
|
@ -378,7 +378,7 @@ SimpleMultipleExample.aasm(:work).states
|
|||
```
|
||||
|
||||
*Final note*: Support for multiple state machines per class is a pretty new feature
|
||||
(since version `4.3`), so please bear with us in case it doesn't as expected.
|
||||
(since version `4.3`), so please bear with us in case it doesn't work as expected.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ module AASM
|
|||
@state_machine.add_state(name, @klass, options)
|
||||
|
||||
if @klass.instance_methods.include?("#{name}?")
|
||||
warn "#{@klass.name}: The state name #{name} is already used!"
|
||||
warn "#{@klass.name}: The aasm state name #{name} is already used!"
|
||||
end
|
||||
|
||||
@klass.class_eval <<-EORUBY, __FILE__, __LINE__ + 1
|
||||
|
@ -86,7 +86,7 @@ module AASM
|
|||
@state_machine.add_event(name, options, &block)
|
||||
|
||||
if @klass.instance_methods.include?("may_#{name}?".to_sym)
|
||||
warn "#{@klass.name}: The event name #{name} is already used!"
|
||||
warn "#{@klass.name}: The aasm event name #{name} is already used!"
|
||||
end
|
||||
|
||||
# an addition over standard aasm so that, before firing an event, you can ask
|
||||
|
|
Loading…
Reference in a new issue