doido-model 0.0.12

SeaORM re-exports plus connection pooling and model testing helpers for Doido apps.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use doido_model::association::{sti_type_column, PolymorphicAssociation};

#[test]
fn polymorphic_belongs_to_uses_type_and_id_columns() {
    let p = PolymorphicAssociation::belongs_to("commentable");
    assert_eq!(p.name, "commentable");
    assert_eq!(p.type_column, "commentable_type");
    assert_eq!(p.id_column, "commentable_id");
}

#[test]
fn sti_discriminator_defaults_to_type() {
    assert_eq!(sti_type_column(), "type");
}