makes models and schema modules privates, adds re-exports
This commit is contained in:
@@ -3,8 +3,9 @@ extern crate diesel;
|
||||
|
||||
use std::io::{stdin};
|
||||
use diesel::SqliteConnection;
|
||||
use self::cookbook::*;
|
||||
use self::models::{NewRecipe, fields::RecipeCategory, fields::IngredientList};
|
||||
use cookbook::*;
|
||||
use cookbook::recipes::{NewRecipe, RecipeCategory};
|
||||
use cookbook::ingredients::{IngredientList};
|
||||
|
||||
struct CreateRecipe<'a> {
|
||||
connection: &'a SqliteConnection,
|
||||
@@ -33,7 +34,7 @@ impl<'a> CreateRecipe<'a> {
|
||||
|
||||
fn add_ingredient(&mut self, name: String) {
|
||||
use crate::ingredients::*;
|
||||
|
||||
let name = name.trim();
|
||||
// Check it exists or create
|
||||
match get_id_or_create(self.connection, &name) {
|
||||
Ok(id) => {
|
||||
|
||||
Reference in New Issue
Block a user