Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix supporting document reference #4

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

AidenEscamilla
Copy link
Owner

@AidenEscamilla AidenEscamilla commented Feb 20, 2024

What

  1. Model to act as intermediary / Join Table for the many-to-many relation between job_applications and supporting_documents
  2. Migration for the described model
  3. Existing model updates to work with the new intermediary
  4. Existing form and display updates to work with new intermediary

Why

Turns out using has_many and/or 'belongs_to' creates an unwanted relationship between the applications and documents. The man-in-the-middle class allows for a common document to now be shared with multiple applications.

The supporting_document form now uses check boxes to select multiple applications. The model #show also displays all the applications it's attached to.

The job_application #show continues to displays all the documents associated and now works with the intermediary linker.

TODO / Next Steps

  • Validations
  • Double check destroy works correctly
  • Move linker.create! Out of the controller and into a Form.object for supporting_document
  • Factory bot for supporting_document
  • document_linker specs

@AidenEscamilla AidenEscamilla merged commit bcc169d into main Feb 21, 2024
1 check passed
@AidenEscamilla AidenEscamilla deleted the fix_supporting_document_reference branch February 21, 2024 01:14
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