Instantly share code, notes, and snippets.

Embed
What would you like to do?
Elixir faker
SampleElixirEctoSelect.Repo.start_link
alias SampleElixirEctoSelect.RssFeed
Enum.map 0..99,
fn _ ->
params = %{
feed_url: Faker.Internet.url,
title: Faker.Commerce.product_name,
subtitle: Faker.Company.bs,
summary: Faker.Lorem.Shakespeare.romeo_and_juliet,
link: Faker.Internet.url,
author: Faker.Name.name,
image: Faker.Internet.image_url,
}
feed = %RssFeed{}
changeset = RssFeed.changeset(feed, params)
try do
SampleElixirEctoSelect.Repo.insert!(changeset)
rescue
# ignore error
_ -> {}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment