question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Doc] seeding database when using Models

See original GitHub issue

I’m running 0.2.0-beta.3. I’ve defined models since I need support for relationships. Seems to work fine. But I haven’t any clue how to seed the database. If I’m running server.create('my-model'); I’m getting an error that I must define a factory. But can’t find any information in docs how models and factories play together.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bbtb1982commented, Jan 23, 2017

I ran into this error today. The Solution for me was to make sure that I had created the accompanying model and not only the factory. It would be nice to add some error handling that points out that a model is attempting to create a relationship on a model that is no defined.

My experience is the errors says something along the lines of cannot find on where() or find() on ‘undefined’ which in context makes sense but I think we can add more descriptive errors for this. Let me know if this is a good idea and if so I’ll take a stab at adding the error messages.

Super thanks for all work. This add-on is one of the primary reasons to why we use ember.

0reactions
samselikoffcommented, Jan 24, 2017

Mm great point - I’ve opened https://github.com/samselikoff/ember-cli-mirage/issues/997 and would love some help!

And thank you very much, I’m glad its solving your problems!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data Seeding - EF Core - Microsoft Learn
Data seeding is the process of populating a database with an initial set of data. There are several ways this can be accomplished...
Read more >
Database: Seeding - The PHP Framework For Web Artisans
Laravel includes the ability to seed your database with data using seed classes. All seed classes are stored in the database/seeders directory. By...
Read more >
Seeding a database | Zell Liew
The process where you add initial content to a database is called seeding. Here, I teach you how to seed a database automatically....
Read more >
Seeding your database - Prisma
This guide describes how to seed your database using Prisma Client and Prisma's integrated seeding functionality. Seeding allows you to consistently ...
Read more >
Seeding test databases in 2021 - best practices - Synth
In this tutorial, we'll learn how to design a Prisma data model for a basic message board and how to seed test databases...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found