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

makes sure no duplicate issues are added into DB when seed file run #252

Merged
merged 1 commit into from
Sep 18, 2017

Conversation

ZooeyMiller
Copy link
Collaborator

Checks if an issue already exists in the database before putting it in in our seed file, so that if the seed file is run multiple times it does not create a bunch of duplicates in the database.
#251

@codecov
Copy link

codecov bot commented Sep 18, 2017

Codecov Report

Merging #252 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #252   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           7      7           
  Lines          82     82           
=====================================
  Hits           82     82

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abdec16...0de54ab. Read the comment docs.

Copy link
Collaborator

@finnhodgkin finnhodgkin left a comment

Choose a reason for hiding this comment

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

Looks good 👍

|> Issue.changeset(issue)
|> Repo.insert!
|> Enum.each(fn (%{"url" => html_url} = issue) ->
unless Repo.get_by(Issue, url: html_url) do
Copy link
Member

Choose a reason for hiding this comment

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

v nice pattern matching 👍

@samhstn samhstn merged commit 5aeeace into master Sep 18, 2017
@samhstn samhstn deleted the fix-seed-file branch September 18, 2017 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants