Skip to content

refactor: Simplify app from Resources to Sermons#279

Merged
tataihono merged 6 commits intomainfrom
refactor/simplify-to-sermons
Mar 28, 2026
Merged

refactor: Simplify app from Resources to Sermons#279
tataihono merged 6 commits intomainfrom
refactor/simplify-to-sermons

Conversation

@tataihono
Copy link
Copy Markdown
Contributor

Summary

  • Drop unused models (Location, Step, Event, Prayer, Service, Article) — zero public usage, minimal data
  • Rename Resource → Sermon, removing STI hierarchy entirely
  • Rename join tables: resource_connection_*sermon_*
  • Update all three surfaces: ActiveAdmin, public views, GraphQL API
  • 111 files changed, 556 insertions, 1342 deletions

Key decisions

  • Flat Sermon model — no STI, no type column. Only sermons ever existed.
  • Public URLs stay at /resources — preserves existing links/SEO
  • Rename tables via migration — preserves UUIDs, data, and foreign keys
  • Polymorphic type columns updatedactive_storage_attachments.record_type, active_admin_comments.resource_type migrated from ResourceSermon

Testing

  • All specs pass (20 examples, 0 failures, 12 pending placeholders)
  • Migration verified reversible (migrate, rollback, migrate)
  • All 652 sermons preserved with relationships intact

Post-Deploy Monitoring & Validation

  • What to monitor/search
    • Logs: Sermon model queries, any Resource or Location NameError exceptions
    • Rollbar: watch for NoMethodError or NameError spikes post-deploy
  • Validation checks
    • Sermon.count should return 652
    • Sermon.first.authors.count should be > 0
    • /resources homepage loads
    • /admin/sermons admin panel loads
    • GraphQL { sermons { nodes { id name } } } returns data
  • Expected healthy behavior
    • All existing pages load without error
    • Admin panel shows Sermons (no Location/Step/Article pages)
  • Failure signal / rollback trigger
    • Any NameError for Resource, Location, or Step → rollback migration
  • Validation window & owner
    • 24 hours post-deploy

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

tataihono and others added 6 commits March 28, 2026 09:04
Drop unused models (Location, Step, Event, Prayer, Service, Article),
rename Resource to Sermon removing STI, rename all join tables, and
update all three surfaces (ActiveAdmin, public views, GraphQL API).

111 files changed, 556 insertions, 1342 deletions. All 652 sermons
and their relationships preserved. Public URLs stay at /resources.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Fix field ordering, string quote style, migration cops, and update
remaining GraphQL queries that still referenced Resource::TYPES.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
.env had only placeholder/dead values — S3 is in encrypted credentials,
SES replaced by Resend, ROCK_API_TOKEN unused. The shared
credentials.yml.enc had no master key and is superseded by
per-environment credential files (development, production).

Added development.yml.enc with S3 credentials for local dev.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…tomatically

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
author_type, scripture_type, series_type, topic_type, category_type
all still had field :resources with Types::ResourceType.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@tataihono tataihono merged commit ffceab7 into main Mar 28, 2026
3 checks passed
@tataihono tataihono deleted the refactor/simplify-to-sermons branch March 28, 2026 09:49
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