Versions VS Approvals
Source: Dev.to
Problem
Today I encountered a tricky problem in a seemingly simple “one record is not showing up in #index” bug‑fix task.
Data situation
Task.pluck(:project_version_id, :is_actual)
#=> [
# [1, true],
# [nil, true]
# ]Both versioned and non‑versioned records can be :actual. Can this be right?
Questions to consider
- Are “draft” data ever persisted in a sort of “lobby”?
- What is more important – accessing possible draft data or the possible latest approved/actual version?
- What operation(s) result in new version(s)?
Depending on the answers, you can end up with one of two systems.
Possible systems

Implications for developers
The key difference is the meaning and importance of unversioned data.
- Versioned case: Regular data are the actual ones, and special access is needed for historic version data.
- Approval pattern: Unversioned data are less important because they are not yet approved.
Naturally, an approval workflow will be harder to reason about and will require careful development to communicate that plain project.tasks.actual is not quite project.last_approved_version.tasks.