~hime/aqua

bcaf50bea7dd4ae9d44a4648f30a72a6c085e77b — Robbie Straw 7 years ago c41bae7
link second association of entries_tags
2 files changed, 5 insertions(+), 2 deletions(-)

M src/models/entry.rs
M src/models/entry_tag.rs
M src/models/entry.rs => src/models/entry.rs +3 -2
@@ 1,7 1,8 @@
use schema::entries;
use schema::{entries, entries_tags};

#[derive(Debug, Identifiable, Queryable, Serialize)]
#[derive(Debug, Associations, Identifiable, Queryable, Serialize)]
#[table_name="entries"]
#[has_many(entries_tags)]
pub struct Entry {
    pub id:   i64,
    pub hash: String,

M src/models/entry_tag.rs => src/models/entry_tag.rs +2 -0
@@ 1,8 1,10 @@
use models::entry::Entry;
use models::tag::Tag;
use schema::entries_tags;

#[derive(Debug, Associations, Identifiable, Queryable, Serialize)]
#[table_name="entries_tags"]
#[belongs_to(Entry)]
#[belongs_to(Tag)]
pub struct EntryTag {
    pub tag_id:   i64,