1
0
Fork 0
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:
Tess Huelskamp 2022-04-14 10:26:01 -07:00 committed by GitHub
parent 1a1b836ded
commit 72d7860d58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -225,14 +225,14 @@ All guards and after callbacks will receive these parameters. In this case `set_
`:defragmentation` argument. `:defragmentation` argument.
If the first argument to the event is a state (e.g. `:running` or `:finished`), the first argument is consumed and 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 ```ruby
job = Job.new job = Job.new
job.run(:running, :defragmentation) job.run(:running, :defragmentation)
``` ```
In this case `set_process` won't be called, job will transition to running state and callback will receive 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 #### Error Handling
In case of an error during the event processing the error is rescued and passed to `:error` 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 Saving includes running all validations on the `Job` class. If
`whiny_persistence` flag is set to `true`, exception is raised in case of `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. `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 If you want make sure the state gets saved without running validations (and
@ -786,7 +786,7 @@ class Job < ActiveRecord::Base
end 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. 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. Please note that only state column will be updated as mentioned in the above example.