You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An "inclusion" error when you are assigning to a state that doesn't exist.
An "invalid" error when you are assigning to a state that is not allowed.
When persisting, it's important that with_lock be used to guard against double-submit race conditions. This is especially important if there are any side-effects to taking the action. (Less important if the action is basically idempotent.)
As part of this, all validation errors, attribute assignment, and callbacks should happen inside of the with_lock block -- it is not enough to put only the call to save inside of the lock if there are other things happening around the persistence.
It should be possible to customize the built-in validation messages via en.yml (since they use the built-in :inclusion and :invalid keys).
The text was updated successfully, but these errors were encountered:
with_lock
be used to guard against double-submit race conditions. This is especially important if there are any side-effects to taking the action. (Less important if the action is basically idempotent.)with_lock
block -- it is not enough to put only the call tosave
inside of the lock if there are other things happening around the persistence.en.yml
(since they use the built-in:inclusion
and:invalid
keys).The text was updated successfully, but these errors were encountered: