Skip to content

README Update: More clearly outline built-in validation behavior and persistence patterns #4

@smudge

Description

@smudge
  1. Built-in validations include:
  • 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.
  1. 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.
  1. It should be possible to customize the built-in validation messages via en.yml (since they use the built-in :inclusion and :invalid keys).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions