Skip to content

atomkirk/ex_ample_data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExAmpleData

Makes it easy to generate example data for your app. Can be useful in dev for seed data, in test for test data and sometimes in production for sales/demo data.

Goals:

  • Easy. I include a single dependency, Faker, because generating quality example data is hard and it does a good job.
  • Valid. Use changesets to help make sure that generated/seed data is validated before being inserted.
  • Efficient. Don't hide building associations. When each factory builds its own relationships, its far too easy to build too many, slowing things (especially tests) down.

It's really easy to build the exact object graph you want:

account = create(:account)
contact = create(:contact, account_id: account.id)
invoice = create(:invoice, contact_id: contact.id)

Installation

If available in Hex, the package can be installed by adding ex_ample_data to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_ample_data, "~> 0.1.0"}
  ]
end

Usage

** TODO **

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_ample_data.

About

Easily generate example data for your app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages