Skip to content

Remove old Channel-to-Zone direct relationships - #139

Merged
livitup merged 2 commits into
mainfrom
feature/105-remove-old-zone-relationships
Dec 18, 2025
Merged

Remove old Channel-to-Zone direct relationships#139
livitup merged 2 commits into
mainfrom
feature/105-remove-old-zone-relationships

Conversation

@livitup

@livitup livitup commented Dec 18, 2025

Copy link
Copy Markdown
Owner

Summary

  • Add migration to remove codeplug_id column from zones table
  • Remove belongs_to :codeplug from Zone model
  • Update Codeplug model to access zones through codeplug_zones join table
  • Remove nested zone routes under codeplugs
  • Clean up ZonesController to only handle standalone zones
  • Update all zone views to use standalone paths only
  • Remove ChannelZonesController (no longer needed with new architecture)
  • Update tests and factories to reflect new architecture
  • Add comprehensive seed data demonstrating new zone workflow

Test plan

  • All unit tests pass (666 runs, 0 failures)
  • Rubocop passes with no offenses
  • Brakeman security scan passes with no warnings
  • Manually verify zone CRUD operations work at /zones
  • Verify adding zones to codeplugs via CodeplugZone works
  • Verify channel generation from zones works
  • Run rails db:seed to verify seed data creates properly

Closes #105

🤖 Generated with Claude Code

cmi-andrewo and others added 2 commits December 17, 2025 20:03
- Add migration to remove codeplug_id column from zones table
- Remove belongs_to :codeplug from Zone model
- Update Codeplug model to access zones through codeplug_zones
- Remove nested zone routes under codeplugs
- Clean up ZonesController to only handle standalone zones
- Update zone views to use standalone paths only
- Remove ChannelZonesController (no longer needed)
- Update tests and factories to reflect new architecture
- Add comprehensive seed data demonstrating new zone architecture

This completes the zone architecture refactor. Zones are now standalone
entities owned by users, linked to codeplugs via the CodeplugZone join
table. The old direct codeplug_id foreign key relationship has been
removed.

Closes #105

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update test_viewing_codeplug_shows_zones_and_channels_summary to create
zones with the standalone pattern (owned by user, linked via CodeplugZone)
instead of the old direct codeplug association.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@livitup
livitup merged commit 70ba537 into main Dec 18, 2025
3 checks passed
@livitup
livitup deleted the feature/105-remove-old-zone-relationships branch December 18, 2025 01:37
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.

Remove old Channel-to-Zone direct relationships

2 participants