Draft
Conversation
This creates a new CommunityResourceImporter class which can be used to import CSV data and create CommunityResource objects and it's associated relationships. At the moment this only creates the primary class and sets the name property. There is still a lot more work to do, but what exists works and IT HAS TESTS!!!
… for the community resource importer
This adds the location and service area models to the community resource being imported.
When importing CommunityResource records, some rows in the dataset will have repeating Organization or Community Resource information. When this happens we want to re-use the existing objects in the database and update them accordingly. Specifically, instead of duplicating a CommunityResource the importer will update it to include the new tag and description.
…resources were concatenated properly. tests passing. created a rake task to import the community resources. downloaded the csv from the spreadsheet and added it into the db/seeds/public_template_csvs. when running the rake task got 'validation failed: name cannot be blank' and the community resources were not created. need to explore what is occurring with that error
Co-authored-by: maebeale <maebeale@gmail.com> Co-authored-by: connieh1 <connie2630a@gmail.com>
Contributor
|
Hi! @maebeale I'll try and take a look at this over the weekend |
| organization: organization | ||
| ) | ||
|
|
||
| resource.tag_list.add(row["category_name"]) |
Contributor
There was a problem hiding this comment.
This needs to iterate because category name is a comma separated list --Mae
|
|
||
| resource.tag_list.add(row["category_name"]) | ||
|
|
||
| resource.location = Location.create! do |location| |
Contributor
There was a problem hiding this comment.
If the organization already exists and has a location, do not create a new location.
…otentcy Co-authored-by: maebeale <maebeale@gmail.com> Co-authored-by: exbinary <exbinary@gmail.com>
997187b to
5cca2be
Compare
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.
Why
What
How
Testing
Next Steps
Outstanding Questions, Concerns and Other Notes
Accessibility
Security
Meta
Pre-Merge Checklist