Versions VS Approvals

Published: (March 23, 2026 at 06:16 AM EDT)
1 min read
Source: Dev.to

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

Version vs Approval diagram

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.

0 views
Back to Blog

Related posts

Read more »

No, Windows Start does not use React

Mar 23, 2026 — Pat Hartl Windows is in the news again. This time Microsoft has put out a standard corporate Our commitment to Windows qualityhttps://blogs.windo...