A generic factory trait.
You shouldn't ever have to implement this trait yourself. It can be derived using
See the root module docs for info on how to use
The model type the factory inserts.
For a factory named
UserFactory this would probably be
The primary key type your model uses.
This will normally be i32 or i64 but can be whatever you need.
The database connection type you use such as
fn insert(self, con: &Self::Connection) -> Self::Model
Insert the factory into the database.
This will panic if the insert fails. Should be fine since you want panics early in tests.
fn id_for_model(model: &Self::Model) -> &Self::Id
Get the primary id value for a model type.
Just a generic wrapper around