faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
wantansoup has joined #amber
wantansoup has quit [Quit: Leaving]
<FromGitter> <ikaru5> Hey guys :) A pretty simple question I guess: ⏎ I have a Granite model named World and trying to call "World.first.id" ⏎ But the compiler says "undefined method 'id' for Nil (compile-time type is (World | Nil))" ⏎ I understand why. But dont know how to solve it "the right way" :D ⏎ In this case there is always a World in the database, so if there is not I would love to see the application fail. :)
<FromGitter> <damianham> World.first.not_nil!.id
<FromGitter> <ikaru5> Thank you!
<FromGitter> <Blacksmoke16> @ikaru5 `World.first!`
<FromGitter> <Blacksmoke16> would be the better way, which would raise if it doesnt exit