feepbot has quit [Remote host closed the connection]
feepbot has joined #amber
<FromGitter>
<Bherivy> Hi, I am new to Crystal and amber. I am looking forward to using Jennifer with Amber. I have checked the guide on https://docs.amberframework.org/amber/guides/models/jennifer, which says "Setup your database informationm," with not further information. Where should I do these configurations? I have tried to checked all the files under `config` directory, but the only thing I can found that relative to database is
<FromGitter>
... `database_url`, which is contains all the information to connect to a database.
<FromGitter>
<Bherivy> I have figured out by myself 😂 It's the configuration file of Jennifer. So just using the same path as the first argument of `Jennifer::Config#read`
<FromGitter>
<Bherivy> awesome! i will take a look, thanks!
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #amber
<FromGitter>
<LilianAvry> Hello ! I am new to Crystal too ! I dont use amber but i am using Granite (with kemal) and i have some problems : I just cant update or delete something in my DB (create & get work). Has anybody got the same problem ?
<FromGitter>
<Bherivy> Hi @LilianAvry, it would be better if you can provide further information. like the error messages when you are tring to update/delete, with the code you are using.
<FromGitter>
<LilianAvry> this is the method i use to update something
<FromGitter>
<LilianAvry> `src/controllers/UserController.cr:21: undefined method 'city=' for Nil (compile-time type is (User | Nil))`
<FromGitter>
<LilianAvry> and that is the error message i get when i try to compile
<FromGitter>
<Bherivy> @LilianAvry did you checked the value of id? ⏎ that error message means that `User.find id` returned `nil`, which means there is no record of `id`
<FromGitter>
<LilianAvry> the value of `id` is correct and when i do `puts user.to_json` it returns correct informations from the DB `{"id":2,"name":"Bernard","age":21,"city":"Meylan"}`
<FromGitter>
<Bherivy> it says that's a compile-time type, which means you have to make sure that `user` it not `Nil`
<FromGitter>
<Bherivy> Crystal checks type when it compiles. It reports such error when the value *could* be `nil`
<FromGitter>
<Blacksmoke16> @LilianAvry can do something like this