Skip to content

The trait bound diesel::BelongingToDsl<> is not implemented for my model #4022

Answered by weiznich
crackheadakira asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for writing this question and providing all these details. That makes it much easier to answer the question.

I've still experienced this issue by copying the documentation 1:1, exact same commands from https://diesel.rs/guides/relations.html

The code for the guides is tested in our CI. It's guaranteed to work, you very likely did not perform a 1:1 copy but missed a important piece.

This is the snippet of code where this is occuring

// src/interface.rs

pub fn get_albums_tracks(album: Albums) {
    let connection = &mut establish_db_connection();

    let _tracks = AlbumTracks::belonging_to(album).load(connection);
}

This is the part of the code that contains the issue. The docu…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@crackheadakira
Comment options

Answer selected by crackheadakira
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants