mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Fix a few typos in README.md (#781)
There's a typo in the readme :) * Update README.md
This commit is contained in:
parent
1a1b836ded
commit
72d7860d58
1 changed files with 4 additions and 4 deletions
|
@ -225,14 +225,14 @@ All guards and after callbacks will receive these parameters. In this case `set_
|
|||
`:defragmentation` argument.
|
||||
|
||||
If the first argument to the event is a state (e.g. `:running` or `:finished`), the first argument is consumed and
|
||||
the state machine will attempt to transition to that state. Add comma separated parameter for gaurds and callbacks
|
||||
the state machine will attempt to transition to that state. Add comma separated parameter for guards and callbacks
|
||||
|
||||
```ruby
|
||||
job = Job.new
|
||||
job.run(:running, :defragmentation)
|
||||
```
|
||||
In this case `set_process` won't be called, job will transition to running state and callback will receive
|
||||
:defragmentation as parameter
|
||||
`:defragmentation` as parameter
|
||||
|
||||
#### Error Handling
|
||||
In case of an error during the event processing the error is rescued and passed to `:error`
|
||||
|
@ -758,7 +758,7 @@ job.aasm.fire!(:run) # saved
|
|||
|
||||
Saving includes running all validations on the `Job` class. If
|
||||
`whiny_persistence` flag is set to `true`, exception is raised in case of
|
||||
failure. If `whiny_persistence` flag is set to false, methods with a bang return
|
||||
failure. If `whiny_persistence` flag is set to `false`, methods with a bang return
|
||||
`true` if the state transition is successful or `false` if an error occurs.
|
||||
|
||||
If you want make sure the state gets saved without running validations (and
|
||||
|
@ -786,7 +786,7 @@ class Job < ActiveRecord::Base
|
|||
end
|
||||
```
|
||||
|
||||
Also You can skip the validation at instance level with `some_event_name_without_validation!` method.
|
||||
Also, you can skip the validation at instance level with `some_event_name_without_validation!` method.
|
||||
With this you have the flexibility of having validation for all your transitions by default and then skip it wherever required.
|
||||
Please note that only state column will be updated as mentioned in the above example.
|
||||
|
||||
|
|
Loading…
Reference in a new issue