Skip to content

Shortcut for timestampsΒ #418

Closed
Closed
@Drenmi

Description

A common and recurring thing we do is implement callbacks for updating timestamps. How about an option for state that automatically updates the timestamp when the record enters that state?

state :finished, timestamp: true
# Will look for an attribute `finished_at`

perhaps with an optional attribute name for flexibility:

state :draft, timestamp: :drafted_at

WDYT?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions