From 6e4afc7d7ddf93753563a2b5935aba4adf1102c5 Mon Sep 17 00:00:00 2001 From: Kacy James Date: Fri, 26 May 2017 14:38:48 -0400 Subject: [PATCH 01/10] Show Minimum Required Functions I think it would be useful to show a complete representation of the model class then go into explaining what does what. Upon reading the documentation, I was under the impression that all I needed to have in order for my model to be valid was: ``` final class Pet: Model { var name: String var age: Int let storage = Storage() init(name: String, age: Int) { self.name = name self.age = age } } ``` --- 2.0/docs/fluent/getting-started.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/2.0/docs/fluent/getting-started.md b/2.0/docs/fluent/getting-started.md index cfab396c..3565dca3 100644 --- a/2.0/docs/fluent/getting-started.md +++ b/2.0/docs/fluent/getting-started.md @@ -18,13 +18,23 @@ final class Pet: Model { var name: String var age: Int let storage = Storage() + + init(row: Row) throws { + name = try row.get("name") + age = try row.get("age") + } init(name: String, age: Int) { self.name = name self.age = age } - - ... + + func makeRow() throws -> Row { + var row = Row() + try row.set("name", name) + try row.set("age", age) + return row + } } ``` From f7a2602fde726b25f7a5e228bf928c36346dd53d Mon Sep 17 00:00:00 2001 From: Kacy James Date: Fri, 26 May 2017 14:43:40 -0400 Subject: [PATCH 02/10] Update getting-started.md --- 2.0/docs/fluent/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2.0/docs/fluent/getting-started.md b/2.0/docs/fluent/getting-started.md index 3565dca3..b4e50d67 100644 --- a/2.0/docs/fluent/getting-started.md +++ b/2.0/docs/fluent/getting-started.md @@ -92,7 +92,7 @@ You can do this by conforming your model to `Preparation`. extension Pet: Preparation { static func prepare(_ database: Database) throws { try database.create(self) { pets in - pets.id(for: self) + pets.id() pets.string("name") pets.int("age") } From 89ecfba1a82acd95d34e06314886ef4b573b75bb Mon Sep 17 00:00:00 2001 From: Kacy James Date: Fri, 26 May 2017 15:04:21 -0400 Subject: [PATCH 03/10] Update getting-started.md --- 2.0/docs/fluent/getting-started.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/2.0/docs/fluent/getting-started.md b/2.0/docs/fluent/getting-started.md index b4e50d67..bd2319a8 100644 --- a/2.0/docs/fluent/getting-started.md +++ b/2.0/docs/fluent/getting-started.md @@ -112,15 +112,15 @@ Here we are creating a simple table that will look like this: ### Add to Droplet -Now you can add your model to the Droplet's prearations so the database is prepared when your application boots. +Now you can add your model to the config's prearations so the database is prepared when your application boots. ```swift import Vapor import FluentProvider -let drop = try Droplet() - -drop.preparations.append(Pet.self) +let config = try Config() +try config.preparations.append(Pet.self) +let drop = try Droplet(config) ... ``` From d5051bab92142435c4d8a538903b0bc3e64036e0 Mon Sep 17 00:00:00 2001 From: Kacy James Date: Fri, 26 May 2017 15:05:15 -0400 Subject: [PATCH 04/10] Update getting-started.md --- 2.0/docs/fluent/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2.0/docs/fluent/getting-started.md b/2.0/docs/fluent/getting-started.md index bd2319a8..40af08a2 100644 --- a/2.0/docs/fluent/getting-started.md +++ b/2.0/docs/fluent/getting-started.md @@ -119,7 +119,7 @@ import Vapor import FluentProvider let config = try Config() -try config.preparations.append(Pet.self) +config.preparations.append(Pet.self) let drop = try Droplet(config) ... From 056bef68122be7f348d9b33ba9c94c8c7c4a0e62 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 26 May 2017 22:14:18 +0200 Subject: [PATCH 05/10] Fix incorrect link to deploy section --- 2.0/docs/getting-started/hello-world.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2.0/docs/getting-started/hello-world.md b/2.0/docs/getting-started/hello-world.md index 0db31c51..35921f25 100644 --- a/2.0/docs/getting-started/hello-world.md +++ b/2.0/docs/getting-started/hello-world.md @@ -164,5 +164,5 @@ Some debug messages will be silenced while in the production environment, so mak !!! warning If you compiled your application with `--release`, make sure to add that flag to the `vapor run` command as well. e.g., `vapor run serve --env=production --release`. -For more information on deploying your code, check out the [deploy section](http://127.0.0.1:8000/deploy/nginx/). +For more information on deploying your code, check out the [deploy section](../deploy/nginx.md). From 10b71c834353ba3973d0e61e28457b84d9e00230 Mon Sep 17 00:00:00 2001 From: "Martin J. Lasek" Date: Sat, 27 May 2017 13:16:35 +0200 Subject: [PATCH 06/10] Make "validation/package.md" documentation accessible from menu on "https://docs.vapor.codes/2.0/" We now have documentation about "validation/package.md" but it is not accessible through the menu on the website "https://docs.vapor.codes/2.0/". This PR should solve that :) --- 2.0/mkdocs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/2.0/mkdocs.yml b/2.0/mkdocs.yml index dd0763e0..0943beaf 100644 --- a/2.0/mkdocs.yml +++ b/2.0/mkdocs.yml @@ -73,7 +73,9 @@ pages: - 'Package': 'leaf/package.md' - 'Provider': 'leaf/provider.md' - 'Overview': 'leaf/leaf.md' -- Validation: 'validation/overview.md' +- Validation: + - 'Package': 'validation/package.md' + - 'Overview': 'validation/overview.md' - Node: - 'Package': 'node/package.md' - 'Getting Started': 'node/getting-started.md' From de4f76b954b274da02750722e1ace8aa61ab9a0f Mon Sep 17 00:00:00 2001 From: Do Hoerin Date: Sun, 28 May 2017 00:56:48 +0900 Subject: [PATCH 07/10] Fix incorrect function name in sample code --- 2.0/docs/http/client.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2.0/docs/http/client.md b/2.0/docs/http/client.md index b007730a..c67c338c 100644 --- a/2.0/docs/http/client.md +++ b/2.0/docs/http/client.md @@ -48,7 +48,7 @@ req.formURLEncoded = Node(node: [ "email": "mymail@vapor.codes" ]) -try drop.client.response(to: req) +try drop.client.respond(to: req) ``` ## Re-usable Connection From 36e566893e52f82e3de0c1b97032f402731a2f54 Mon Sep 17 00:00:00 2001 From: Logan Wright Date: Tue, 30 May 2017 12:14:22 +0100 Subject: [PATCH 08/10] lots of people getting hung up on executable, added image --- 2.0/docs/getting-started/xcode.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/2.0/docs/getting-started/xcode.md b/2.0/docs/getting-started/xcode.md index 7d33c894..82b6197a 100644 --- a/2.0/docs/getting-started/xcode.md +++ b/2.0/docs/getting-started/xcode.md @@ -8,6 +8,12 @@ You can build, run, and stop your server from within Xcode, as well as use break To use Xcode, you will first need to generate a `*.xcodeproj` file. +### Select 'Run' + +Make sure after generating your Xcode project that you properly select the executable if you're trying to run your application. + +select 'run' from dropdown + ## Generate Project ### Vapor Toolbox From c52858e3aa847f2e6728faf4b751a48d4ecbb135 Mon Sep 17 00:00:00 2001 From: Logan Wright Date: Tue, 30 May 2017 18:32:14 +0100 Subject: [PATCH 09/10] Update manual section. --- 2.0/docs/leaf/provider.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/2.0/docs/leaf/provider.md b/2.0/docs/leaf/provider.md index f590c426..2b6466aa 100644 --- a/2.0/docs/leaf/provider.md +++ b/2.0/docs/leaf/provider.md @@ -43,9 +43,8 @@ You can also set the `drop.view` property manually if you want to hardcode your import Vapor import LeafProvider -let drop = try Droplet() - -drop.view = LeafRenderer(viewsDir: drop.viewsDir) +let view = LeafRenderer(viewsDir: drop.viewsDir) +let drop = try Droplet(view: view) ``` ## Done From 86c6715dc838701c5621f9b17c1effa03796006d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valent=C3=ADn=20Corral=20Garc=C3=ADa?= Date: Wed, 31 May 2017 14:03:07 +0200 Subject: [PATCH 10/10] Update database.md --- 2.0/docs/fluent/database.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2.0/docs/fluent/database.md b/2.0/docs/fluent/database.md index bf09e9fa..d3044b7b 100644 --- a/2.0/docs/fluent/database.md +++ b/2.0/docs/fluent/database.md @@ -58,10 +58,10 @@ The above prepare statement results in SQL similar to the following: CREATE TABLE `users` (`id` INTEGER PRIMARY KEY NOT NULL, `name` TEXT NOT NULL, `age` INTEGER NOT NULL) ``` -Once you have created you preparation, add it to the Droplet's prepratations array. +Once you have created you preparation, add it to the Config's prepratations array. ```swift -drop.preparations.append(User.self) +config.preparations.append(User.self) ``` ### Create