From 4d18ac53dec14082ca5542eb0d577d5b508788db Mon Sep 17 00:00:00 2001 From: Karim Bogtob Date: Sun, 26 Mar 2023 15:23:30 +0200 Subject: [PATCH] Question 3.1 - Tester la creature --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 1c148b3..784f3ac 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,21 @@ Question 3 : * La migration n'est pas lancée sur la base * `rails db:migrate` +* Question 3.1 : + +Je teste la creature dans une console rails que je lance avec `rails console` : + +```ruby +❯ rails console +Loading development environment (Rails 7.0.4.3) +irb(main):001:0> c = Creature.create(name: "Thrall", health_points: 489) + TRANSACTION (0.1ms) begin transaction + Creature Create (0.4ms) INSERT INTO "creatures" ("name", "health_points", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "Thrall"], ["health_points", 489], ["created_at", "2023-03-26 13:19:57.492017"], ["updated_at", "2023-03-26 13:19:57.492017"]] + TRANSACTION (0.9ms) commit transaction +=> +# c.to_label +=> "Thrall (489)" +``` +