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
vivus has quit [Quit: Leaving]
_whitelogger has joined #amber
vivus has joined #amber
_whitelogger has joined #amber
vivus has quit [Remote host closed the connection]
<FromGitter> <Hansterdam> I can use some help around the Union types and how to get rid of that. So, I'm retrieving an object from the DB with granite using <Class>.find :id. Then I want to toggle a value on that and save it again. But, since it's of a type <Class> | Nil, I cannot just do that. But how do I get rid of the Nil? If I wrap it in an if statement with .not_nil! or != Nil or <Object>.class == <Class>. Nothing gets rid of the
<FromGitter> ... union and it still throws compile errors. I could of course create two functions and overload them for <Class> and Nil, but if I keep doing that I'm just getting a big bunch of Nil functions that do nothing... Far from ideal. How to solve this?
<FromGitter> <Hansterdam> Sorry for that !<Class>.nil? does seem to work
_whitelogger has joined #amber
feepbot has quit [Ping timeout: 272 seconds]
feepbot has joined #amber
<FromGitter> <Blacksmoke16> using Granite @Hansterdam ?
<FromGitter> <Blacksmoke16> you can use `.find!` to raise on nil so that crystal knows it cannot be nil
<FromGitter> <robacarp> Just make sure you’re rescuing from the exception elsewhere 😬
<FromGitter> <Hansterdam> @Blacksmoke16 Ah, thanks! That was what I was looking for :)
<FromGitter> <Hansterdam> @robacarp 😁
<FromGitter> <Blacksmoke16> np, but yea as robacarp said, make sure you handle when an id isnt found
vivus has joined #amber
pracabor is now known as robacarp
hightower6 is now known as hightower2
hightower2 has quit [Changing host]
hightower2 has joined #amber
hightower2 has quit [Remote host closed the connection]
hightower2 has joined #amber
<FromGitter> <Thellior> @Hansterdam There is also destroy! update! save! methods :)
<FromGitter> <Thellior> Someone knows how to create a macro variable? ⏎ I tried ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5b7c8f23f86b741b05a463af]
hightower2 has quit [Changing host]
hightower2 has joined #amber
hightower5 has joined #amber
hightower5 is now known as hightower3
hightower3 has quit [Changing host]
hightower3 has joined #amber
hightower2 has quit [Ping timeout: 264 seconds]
<robacarp> @thellior, for non-output macro work, use {% and %} instead of {{ }}, similar to liquid