Skip to content

Consolidate scheduled_at into published_at#130

Merged
nwwatson merged 2 commits intomasterfrom
consolidate-scheduled-at-into-published-at
Mar 17, 2026
Merged

Consolidate scheduled_at into published_at#130
nwwatson merged 2 commits intomasterfrom
consolidate-scheduled-at-into-published-at

Conversation

@nwwatson
Copy link
Copy Markdown
Owner

Summary

  • Remove the redundant scheduled_at column — published_at now serves both purposes: published posts have published_at <= now, scheduled posts have published_at in the future, drafts have published_at: nil
  • Eliminate all COALESCE expressions and effective_published_at helper throughout models, scopes, and queries
  • Conditionally show the "Publish at" datetime field in the editor settings pane only when status is "scheduled"
  • Update MCP tools (schedule_post, post_serializer) to use published_at exclusively

Test plan

  • All 45 related unit tests pass (publishable, discoverable, MCP serializer, MCP sessions controller, publish scheduled posts job)
  • RuboCop clean on all changed Ruby files
  • Verify editor drawer shows "Publish at" field only when status is set to "scheduled"
  • Verify publishing a draft sets published_at to current time
  • Verify scheduling a post sets published_at to the chosen future time
  • Verify reverting to draft clears published_at

🤖 Generated with Claude Code

Nicholas Watson and others added 2 commits March 17, 2026 09:27
Remove the redundant scheduled_at column — published_at now serves both
purposes: a published post has published_at <= now, a scheduled post has
published_at in the future, and drafts have published_at nil. This eliminates
COALESCE expressions and nil fallbacks throughout the codebase.

Also conditionally show the "Publish at" datetime field only when status is
"scheduled" in the editor settings pane.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SQLite drops triggers when it recreates a table during remove_column.
Restore the posts_fts insert/update/delete triggers so full-text search
stays in sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nwwatson nwwatson merged commit 2c3e7a6 into master Mar 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant