From 656b2012444b9da68baa80e819ad0a5a763ac961 Mon Sep 17 00:00:00 2001 From: Bat Date: Mon, 23 Apr 2018 16:19:28 +0100 Subject: [PATCH] Pluralize model modules --- src/models/instance.rs | 2 +- src/models/mod.rs | 4 ++-- src/models/{post.rs => posts.rs} | 0 src/models/{user.rs => users.rs} | 0 src/routes/blogs.rs | 2 +- src/routes/posts.rs | 4 ++-- src/routes/session.rs | 4 ++-- src/routes/user.rs | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) rename src/models/{post.rs => posts.rs} (100%) rename src/models/{user.rs => users.rs} (100%) diff --git a/src/models/instance.rs b/src/models/instance.rs index d6f4fb8d..09befd27 100644 --- a/src/models/instance.rs +++ b/src/models/instance.rs @@ -2,7 +2,7 @@ use diesel; use diesel::{ QueryDsl, RunQueryDsl, ExpressionMethods, PgConnection }; use std::iter::Iterator; use schema::{instances, users}; -use models::user::User; +use models::users::User; #[derive(Identifiable, Queryable)] pub struct Instance { diff --git a/src/models/mod.rs b/src/models/mod.rs index 360d2478..9ff6a8b6 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -2,5 +2,5 @@ pub mod blog_authors; pub mod blogs; pub mod instance; pub mod post_authors; -pub mod post; -pub mod user; +pub mod posts; +pub mod users; diff --git a/src/models/post.rs b/src/models/posts.rs similarity index 100% rename from src/models/post.rs rename to src/models/posts.rs diff --git a/src/models/user.rs b/src/models/users.rs similarity index 100% rename from src/models/user.rs rename to src/models/users.rs diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index d1d06fde..2c8bafa3 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -8,7 +8,7 @@ use db_conn::DbConn; use models::blogs::*; use models::blog_authors::*; use models::instance::Instance; -use models::user::User; +use models::users::User; use activity_pub::Actor; #[get("/~/", rank = 2)] diff --git a/src/routes/posts.rs b/src/routes/posts.rs index 2451f38f..cee2def9 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -7,9 +7,9 @@ use heck::KebabCase; use utils; use db_conn::DbConn; use models::blogs::*; -use models::post::*; +use models::posts::*; use models::post_authors::*; -use models::user::User; +use models::users::User; #[get("/~//", rank = 3)] fn details(blog: String, slug: String, conn: DbConn) -> String { diff --git a/src/routes/session.rs b/src/routes/session.rs index 06c7d04a..621171dd 100644 --- a/src/routes/session.rs +++ b/src/routes/session.rs @@ -2,12 +2,12 @@ use std::collections::HashMap; use rocket_contrib::Template; use rocket::response::Redirect; use rocket::request::Form; -use models::user::User; +use models::users::User; use rocket::response::status::NotFound; use rocket::http::Cookies; use db_conn::DbConn; use rocket::http::Cookie; -use models::user::AUTH_COOKIE; +use models::users::AUTH_COOKIE; #[get("/login")] fn new() -> Template { diff --git a/src/routes/user.rs b/src/routes/user.rs index f5857f89..60a4fbb6 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -4,7 +4,7 @@ use rocket_contrib::{Json, Template}; use std::collections::HashMap; use db_conn::DbConn; -use models::user::*; +use models::users::*; use models::instance::Instance; use activity_pub::Actor;