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
<FromGitter> <charleystran> could someone help me with an association issue that I am having? I have an Entry who has_one :factor_set the factor_set belongs_to :entry . However when I try to access the factor_set from the entry via ```== entry.factor_set.id``` I get this error at compile time ```undefined method 'id' for Nil (compile-time type is (FactorSet | Nil))``` Any advice on how to get around that to access the association? ps - my
<FromGitter> ... other has_many, belongs_to relationships work just fine
<FromGitter> <Blacksmoke16> try `entry.factor_set!`
<FromGitter> <Blacksmoke16> the `!` will raise if it was not found, but if its possible `entry` wouldnt have a `factor_set` would have to do something like
<FromGitter> <Blacksmoke16> ```if fs = entry.factor_set ⏎ xx == fs.id ⏎ end``` [https://gitter.im/amberframework/amber?at=5cf7eda8faac643934457505]
<FromGitter> <Blacksmoke16> to make sure it has one
<FromGitter> <Blacksmoke16> @charleystran ^
<FromGitter> <charleystran> no exception is raised, when I look directly in the DB, there is a factor_set with the entries id
<FromGitter> <charleystran> ok, wait maybe that worked. Thanks!
<FromGitter> <Blacksmoke16> it basically does like `entry.factor_set.not_nil!`
<FromGitter> <Blacksmoke16> so if you *know* they're going to have one (because of DB FKs or something) can use that to avoid the nil checks
<FromGitter> <charleystran> awesome, that is very helpful
<FromGitter> <nsuchy> Is there something like this for amber
<FromGitter> <Blacksmoke16> i doubt it
<FromGitter> <nsuchy> @Blacksmoke16 project idea ;) you are crystal god
<FromGitter> <Blacksmoke16> haha
<FromGitter> <nsuchy> Is there a way to pass log data into a method?
<FromGitter> <nsuchy> New Crystal release out, has the amber team looked at all the stuff it breaks yet?
<FromGitter> <Blacksmoke16> granite did
<FromGitter> <Blacksmoke16> idk how to fix it atm
<FromGitter> <Blacksmoke16> https://github.com/crystal-lang/crystal/pull/7818#issuecomment-498086324 kinda screws how we been doing serialization
<FromGitter> <Blacksmoke16> since including the serializable will override the initializers from the base class...