jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
yukai has quit [Ping timeout: 264 seconds]
melthelesbian has quit [Read error: Connection reset by peer]
kevinsjoberg has quit [Read error: Connection reset by peer]
kevinsjoberg has joined #crystal-lang
melthelesbian has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
<riffraff169> im still learning crystal, wont be able to talk, but would like to attend
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 246 seconds]
avane has quit [Quit: ZNC - https://znc.in]
avane has joined #crystal-lang
deimos_ has quit [Remote host closed the connection]
Andriamanitra has joined #crystal-lang
<FromGitter> <ilourt> Hi all,
<FromGitter> <ilourt> I'm using Granite as an orm. I want to have a base model class (with columns) and then use it by inheritance in other models. The problem is that I have the following error linked with granite: `Error: class variable '@@validators' of App::Models::BaseModel is already defined as Array(NamedTuple(field: String, message: String, block: Proc(App::Models::Zone, Bool))) in App::Models::MyModel`
<FromGitter> <ilourt> Someon have any idea how I could achieve inheritance with Granite ORM?
<FromGitter> <grkek> How does one pass a function as an argument?
<FromGitter> <naqvis> @grkek use `Proc`
<FromGitter> <grkek> Understandable
<FromGitter> <naqvis> or you can use block
<FromGitter> <grkek> Do you know any block magic?
<FromGitter> <naqvis> in what sense?
<FromGitter> <naqvis> btw you can pass methods as block as well
<FromGitter> <grkek> Cool tricks with blocks
<FromGitter> <grkek> Hm how do I do that?
<FromGitter> <naqvis> just prepend `&`
<FromGitter> <grkek> Why can't setter methods use blocks?
<FromGitter> <grkek> Can you show me an example of passing a function in a block?
<FromGitter> <j8r> there is also `my_func &->other_func`
<FromGitter> <Dan-Do> > Can you show me an example of passing a function in a block? ⏎ ⏎ macro `content_for` in kemal uses block
<FromGitter> <naqvis> @ilourt don't know Granite, but a quick look at their code base revealed that, `Granite::Base` isn't designed to be used in your use-case. Both Base and `Validators` have defined macro `inherited` hook, which got executed during compilation time, and causes the code inside those macros to get added to classes.
<FromGitter> <naqvis> For your use-case you might try to composition approach other than inheritance heriarchy
<FromGitter> <ilourt> @naqvis thanks for your answer. It is very annoying that we can not use the base of the OOP. The problem is that there is no real good orm in crystal :(
<FromGitter> <Dan-Do> what db are you using?
<FromGitter> <ilourt> postgres
<FromGitter> <Dan-Do> fair enough, I am using nosql, which return JSON, so easier :)
f1reflyylmao is now known as f1refly
<FromGitter> <ilourt> ;) In this case I have no choice but to use sql
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 240 seconds]
<FromGitter> <naqvis> I haven't tried, but don't know if you had looked into https://github.com/ysbaddaden/rome
f1reflyylmao is now known as f1refly
<FromGitter> <Nicolab> Look nice rome ORM
<mps> looks like crystal have issue with futex https://www.openwall.com/lists/musl/2020/10/28/10
<FromGitter> <wyhaines> @ilourt Have you looked at Jennifer? https://github.com/imdrasil/jennifer.cr
<FromGitter> <Blacksmoke16> @ilourt see https://github.com/amberframework/granite/issues/358
alexherbo2 has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> hi
<FromGitter> <Blacksmoke16> o/
<FromGitter> <ImAHopelessDev_gitlab> how have you been, @Blacksmoke16 ?
<FromGitter> <Blacksmoke16> not too bad
<FromGitter> <RespiteSage> @mps Is that likely to be a Crystal problem rather than an LLVM problem?
<FromGitter> <RespiteSage> Oh, well it looks like Zig is an LLVM language, and that works...
<mps> RespiteSage: same llvm but with musl 1.2.0 works fine
<mps> musl 1.2.1 exposed a lot of buggy software around
<mps> because musl 1.2.1 is strict about MT-unsafe 'working'
alexherbo2 has quit [Ping timeout: 264 seconds]
sorcus has quit [Quit: WeeChat 2.9]
sorcus has joined #crystal-lang
teardown has quit [Remote host closed the connection]
sorcus has quit [Client Quit]
sorcus has joined #crystal-lang
teardown has joined #crystal-lang
alexherbo2 has joined #crystal-lang
teardown has quit [Ping timeout: 240 seconds]
teardown has joined #crystal-lang
teardown has quit [Ping timeout: 240 seconds]
teardown has joined #crystal-lang
masterdonx2 has quit [Ping timeout: 256 seconds]
teardown has quit [Ping timeout: 240 seconds]
<FromGitter> <rishavs> What's the latest and greatest in the Crystal ecosystem for hot reloading. I remember Sentry was the big one a few years ago.
<FromGitter> <Blacksmoke16> i just use nodemon
<FromGitter> <rishavs> thats revelatory. I never knew nodemon could also monitor cystal projects. Thanks
sampope has joined #crystal-lang
<FromGitter> <Blacksmoke16> `nodemon --exec crystal run --watch src` is what i do
<sampope> anyone have experience/pointers on using Time.format for RFC 3339? I cannot seem to wrap my head around the api call, ```https://crystal-lang.org/api/0.35.1/Time/Format/RFC_3339.html```
duane has quit [Ping timeout: 240 seconds]
<FromGitter> <rishavs> Thank @Blacksmoke16 . `nodemon --exec "crystal run" src/kaipi.cr --watch src -e cr,ecr,md,json` works well for me
<FromGitter> <Blacksmoke16> 👍
<sampope> here's a code snippet, https://dpaste.org/74Fg
<sampope> time.to_rfc3339 doesn't exist, and reading the rfc3339.cr source isn't helping me
MasterdonX has joined #crystal-lang
<FromGitter> <Blacksmoke16> whats the goal here? just trying to output a string in rfc3339 format from a `Time` object?
<FromGitter> <Blacksmoke16> `timestamp.to_rfc3339 fraction_digits: 3` ?
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/9wda
sampope has quit [Remote host closed the connection]
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Time.html#to_rfc3339(*,fraction_digits:Int=0)-instance-method
sampope has joined #crystal-lang
<sampope> thanks @Blacksmoke16, i must be dumb today, i could swear timestamp.to_rfc3339 failed repeatedly for me in the playground
<sampope> of course, now ```puts timestamp.to_rfc3339(fraction_digits: 3)``` works fine. ugh
<FromGitter> <Blacksmoke16> :p
<FromGitter> <Blacksmoke16> Np
masterdonx2 has joined #crystal-lang
MasterdonX has quit [Ping timeout: 264 seconds]
masterdonx2 is now known as MasterdonX
sagax has joined #crystal-lang
sampope has quit [Quit: sampope]
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang