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

Community resource importer #918

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Conversation

svileshina
Copy link
Collaborator

@svileshina svileshina commented Mar 27, 2021

Why

What

How

Testing

Next Steps

  • line 39, 62 check how tag list/category names are being added
  • Line 74: create ServiceArea if it DOESNT already exist (change 75-83 because of service area being multiple)
  • Line 92: make sure this Location isn’t created every time this is run if service area already has a location
  • Service areas need to be comma separated (service areas, categories, locations all need to look the same)

Outstanding Questions, Concerns and Other Notes

Accessibility

Security

Meta

Pre-Merge Checklist

  • Security & accessibility have been considered
  • Tests have been added, or an explanation has been given why the features cannot be tested
  • Documentation and comments have been added to the codebase where required
  • Entry added to CHANGELOG.md if appropriate
  • Outstanding questions and concerns have been resolved
  • Any next steps have been turned into Issues or Discussions as appropriate

cattywampus and others added 9 commits September 6, 2020 15:28
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!!!
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 <[email protected]>
Co-authored-by: connieh1 <[email protected]>
@grenewode
Copy link
Contributor

Hi! @maebeale I'll try and take a look at this over the weekend

@grenewode grenewode self-assigned this Apr 1, 2021
organization: organization
)

resource.tag_list.add(row["category_name"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the organization already exists and has a location, do not create a new location.

@Connieh1 Connieh1 force-pushed the community_resource_importer branch from 997187b to 5cca2be Compare April 3, 2021 15:41
@solebared solebared mentioned this pull request Oct 15, 2021
26 tasks
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.

7 participants