clippy/cleanup
This commit is contained in:
@@ -2,13 +2,27 @@ use diesel::prelude::*;
|
||||
use crate::models::Participant;
|
||||
use crate::schema::conversation_participants;
|
||||
|
||||
#[derive(Queryable, Selectable, AsChangeset, Clone, PartialEq, Debug, Identifiable)]
|
||||
#[derive(Queryable, Selectable, AsChangeset, Identifiable)]
|
||||
#[diesel(table_name = crate::schema::participants)]
|
||||
pub struct Record {
|
||||
pub id: i32,
|
||||
pub display_name: String
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[diesel(table_name = crate::schema::participants)]
|
||||
pub struct InsertableRecord {
|
||||
pub display_name: String
|
||||
}
|
||||
|
||||
impl From<Participant> for InsertableRecord {
|
||||
fn from(participant: Participant) -> Self {
|
||||
InsertableRecord {
|
||||
display_name: participant.display_name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Identifiable, Selectable, Queryable, Associations, Debug)]
|
||||
#[diesel(belongs_to(super::conversation::Record, foreign_key = conversation_id))]
|
||||
#[diesel(belongs_to(Record, foreign_key = participant_id))]
|
||||
|
||||
Reference in New Issue
Block a user