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

Update 2015-12-08-populating-database-tables-from-a-csv-in-elixir.md #1

Closed
wants to merge 1 commit into from

Conversation

@josevalim
Copy link
Contributor

commented Dec 22, 2015

This is not an actual pull request but, since there was no comment section, I thought you would like to know some of the features in Ecto 1.1 that would make the code more straight-forward, like Repo.insert_and_update!.

Also, Ecto will only issue an update if there are changes in the changeset, so instead of checking each field directly, you can simply check if changeset.changes == %{} or not just call Repo.update, as no query is sent in case of no changes.

Thanks for the article and for writing about Elixir!

Update 2015-12-08-populating-database-tables-from-a-csv-in-elixir.md
This is not an actual pull request but, since there was no comment section, I thought you would like to know some of the features in Ecto 1.1 that would make the code more straight-forward, like Repo.insert_and_update!. Thanks for the article and for writing about Elixir!

@rymai rymai added the improvement label Dec 22, 2015

@rymai rymai self-assigned this Dec 22, 2015

@rymai

This comment has been minimized.

Copy link
Owner

commented Dec 22, 2015

Thanks so much José, you're part of why I love Elixir!

Merged in 9958bde (I've update the rest of the blog post as well).

@rymai rymai closed this Dec 22, 2015

@josevalim

This comment has been minimized.

Copy link
Contributor Author

commented Dec 23, 2015

❤️ 💚 💙 💛 💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.