-
Notifications
You must be signed in to change notification settings - Fork 19
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
Correspondence - Add validation to foreign keys #20474
Conversation
…pondence_type factories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work on this! Tests are looking good and seed data is all looking good as well. My only request is if you could add the updated_by_id to the correspondence.rake task in the create_correspondences_with_documents, create_correspondence, and create_multi_correspondences methods in that rake task. With these changes, we are going to need to blow up our current UAT data and re-run that rake tasks with the correct relationships.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factory refinements by Alex are truly awesome, way to go team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work!
* presence validation added. * fixed failing tests due to validations * changed data to be less confusing * fixed failing test * added foreign key validation at the db level * Fixed failing tests. * Added additional let! statements to stub data * fixed linting * Fixed failing specs (all of them) by stubbing more correspondence data * Updated correspondence factors to supply all required foreign key objects. * modified correspondence helpers to use only factory. * Fixed failing specs * removed redundant info * updated spec to fix failing validations * Changed seed order to support Correspondence validations * fixed linting issues * Added correspondence_type factory * Modified correspondence factory so that it uses user, veteran, correspondence_type factories. * Added package_document_type factory, changed correspondence factory to use it. * Added association for assigned_by * Updated to use factories for user, removed useless assignments * Removed redundant code * fixed failing spec. * fixed failing spec * added updated_to_id to all correspondences --------- Co-authored-by: Jim Foley <james.foley4@va.gov>
Resolves Add validation to foreign keys
Description
These changes modify the Correspondence Model to have validation for the following foreign keys, and will reject the data if saved without having them present.
Acceptance Criteria
Testing Plan
Correspondence.create!
Correspondence.create!( updated_by_id: 1, correspondence_type_id: 1, assigned_by_id: 1, veteran_id: 1, package_document_type_id: 1
)Tests
Test Coverage
Did you include any test coverage for your code? Check below:
Code Climate
Your code does not add any new code climate offenses? If so why?