Convert quotable item quote data to direct quotes#1005
Open
Conversation
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Copilot stopped work on behalf of
maebeale due to an error
February 15, 2026 07:17
Collaborator
|
@copilot try again |
…onship Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Contributor
Author
Completed the full conversion from Key changes in commit fb9f825:
The changes are ready for review. After running migrations, the |
Copilot
AI
changed the title
[WIP] Convert quotable item quote data to direct quotes
Convert quotable item quote data to direct quotes
Feb 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the goal of this PR and why is this important?
This PR simplifies the quote data architecture by converting from a join table pattern to direct polymorphic relationships. Currently, quotes are related to quotable items (workshops, reports, workshop_logs) through a
quotable_item_quotesjoin table. Since quotes are rarely shared between items in production, we can eliminate this unnecessary complexity by making quotes directly belong to quotable items.How did you approach the change?
Database Migrations:
quotable_id,quotable_type) to thequotestablequotable_item_quotestoquotesModels:
Quotemodel to use directbelongs_to :quotable, polymorphic: truerelationshipWorkshopandReportmodels fromhas_many :quotable_item_quotestohas_many :quotes, as: :quotableReportmodel to usequotesdirectlyControllers:
WorkshopLogsControllerform building logic (removed nested join table complexity)quotes_attributesinstead ofquotable_item_quotes_attributesViews:
:quotesdirectly instead of:quotable_item_quotes_quote_fields.html.erbpartialquote.quotableaccessDecorators & Tests:
QuoteDecoratorto use directobject.quotableaccessArchitecture Change:
Quote ←→ QuotableItemQuote ←→ Quotable (Workshop/Report/WorkshopLog)Quote → Quotable (direct polymorphic relationship)Anything else to add?
The
quotable_item_quotestable is preserved to ensure safe rollback capability. It can be removed in a follow-up after production verification.Comprehensive migration instructions, rollback plan, and testing guidance are documented in
MIGRATION_NOTES.md.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.