00:16
eseyman left,
manu_ joined
00:18
manu_ is now known as eseyman
00:29
arkiuat joined
00:33
arkiuat left
00:54
arkiuat joined
00:59
arkiuat left
01:20
hulk joined
01:21
kylese left
01:29
arkiuat joined
01:34
arkiuat left
01:55
arkiuat joined
02:00
arkiuat left
02:15
hulk left,
kylese joined
02:20
arkiuat joined
02:37
apogee_ntv left
02:39
apogee_ntv joined
02:55
dg left
03:06
deoac left
03:17
librasteve_ left
03:19
stanrifkin_ joined
03:22
stanrifkin left
03:29
arkiuat left
03:30
Aedil joined
03:41
arkiuat joined
03:46
arkiuat left
03:58
arkiuat joined
04:05
arkiuat left
04:18
arkiuat joined
04:23
arkiuat left
04:30
stanrifkin_ left
04:35
arkiuat joined
04:50
kylese left,
kylese joined
05:06
melezhik joined
06:55
Sgeo left
07:15
melezhik left
07:17
melezhik joined
07:35
_________ left
07:40
arkiuat left
07:51
kylese left
07:52
kylese joined
07:57
bd3i left,
bd3i joined
08:03
wayland joined
08:04
dakkar joined
08:06
arkiuat joined
08:12
arkiuat left
08:20
deoac joined
08:25
arkiuat joined
08:29
lichtkind joined
08:30
arkiuat left
08:32
deoac left
08:45
arkiuat joined
08:49
arkiuat left
09:04
lichtkind left
09:08
lichtkind joined
09:16
Aedil left
09:17
arkiuat joined
09:26
arkiuat left
09:27
avar joined
09:42
arkiuat joined
09:46
arkiuat left
09:57
librasteve_ joined
10:14
arkiuat joined
10:20
arkiuat left
10:33
arkiuat joined
10:38
arkiuat left
10:51
arkiuat joined
10:56
arkiuat left
11:05
melezhik left
11:06
holyghost joined
11:19
apac joined
11:20
arkiuat joined
11:27
arkiuat left
11:28
mst left
11:29
Guest8010 joined
11:33
apa_c joined
11:34
apac left,
Aedil joined
11:41
apa_c left
11:56
arkiuat joined
12:00
arkiuat left,
librasteve_ left
12:17
arkiuat joined
12:21
melezhik joined
12:32
arkiuat left
13:02
arkiuat joined
13:04
apa_c joined
13:06
arkiuat left
13:10
deoac joined
13:18
librasteve_ joined
13:25
arkiuat joined
13:29
arkiuat left
|
|||
disbot4 | <librasteve> seen: SmokeMachine | 13:55 | |
SmokeMachine | hi! | ||
librasteve_ | seen: SmokeMachine | ||
tellable6 | librasteve_, I saw SmokeMachine 2025-08-07T13:55:33Z in #raku: <SmokeMachine> hi! | ||
SmokeMachine | librasteve_: Hi, I'm here! :) | 13:56 | |
disbot4 | <librasteve> hi … does Red support polymorphic models, like this Rails example chatgpt.com/share/6894b022-3cd4-80...64c1827ecc | ||
<librasteve> hope you are well | 13:57 | ||
13:57
arkiuat joined
14:02
arkiuat left
|
|||
librasteve_ | weekly: glot.io/snippets/h9xwkwdb7z | 14:03 | |
notable6 | librasteve_, Noted! (weekly) | ||
14:05
_________ joined
|
|||
SmokeMachine | librasteve_: I don't like to do that on my DB, but if I understood that correctly, that seems to be what I call `Source and Source-id` on the cookbook (fco.github.io/Red/tutorials/cookbook.html). Could you confirm if that's it? | 14:07 | |
14:21
Sgeo joined
14:23
apa_c left
|
|||
disbot4 | <librasteve> looking good, specifically the Rails example wants model Comment to be related to both Posts (see all comments on this Post) and Person (see all comments this person has written) … my understanding is that this can be done with Red since one target model can be included in multiple relationships from multiple other models - so yeah that’s good! | 14:24 | |
14:26
arkiuat joined
|
|||
SmokeMachine | librasteve_: you can also, probably, add that as a role if you want... | 14:26 | |
librasteve_: if possible, could you share the code you use it, please? (That's ok if you don't...) | 14:29 | ||
14:30
arkiuat left
|
|||
SmokeMachine | librasteve_: for comments, I probably wouldn't use that... I would probably do something like this: | 14:33 | |
github.com/FCO/BlogSchema/blob/mas...akumod#L11 | |||
github.com/FCO/BlogSchema/blob/mas...akumod#L18 | |||
github.com/FCO/BlogSchema/blob/mas...nt.rakumod | |||
and for commenting on different "entities", I would probably make a role... after work I can try writing something like that to try... | 14:36 | ||
14:41
melezhik left
14:58
arkiuat joined
15:04
arkiuat left
15:07
wayland left,
wayland joined
15:18
stanrifkin joined
15:27
arkiuat joined
15:32
arkiuat left
15:33
arkiuat joined
15:38
arkiuat left
16:02
arkiuat joined
16:11
arkiuat left
16:22
melezhik joined,
deoac left
16:28
arkiuat joined
|
|||
disbot4 | <librasteve> SmokeMachine: for clarity there was an HN news item about ORMs and someone complaining that xyz does not support polymorphism - I wanted to say "use Red - that supports polymorphism and is so cool" ... so this was about me getting my facts straight for the next time it comes up | 16:28 | |
<librasteve> (no code from me on blog website quite yet ... but one day I'm gonna drop wordpress and use raku!) | 16:29 | ||
<librasteve> still would be an awesome example | |||
16:32
dakkar left
16:33
arkiuat left
16:58
arkiuat joined
17:04
xkr47 left,
arkiuat left
17:05
xkr47 joined
17:19
apa_c joined
17:26
arkiuat joined
17:27
Guest26 joined
17:28
Guest26 left
17:33
arkiuat left
17:45
arkiuat joined
17:47
tgt joined
17:48
tgt left,
tgt joined
17:49
tgt left,
tgt joined
17:50
arkiuat left
17:51
tgt left,
tgt joined,
tgt left,
tgt joined,
tgt left
18:18
arkiuat joined
18:23
arkiuat left
18:37
arkiuat joined
18:41
arkiuat left
|
|||
disbot4 | <librasteve> lizmat: would you mind taking a look at this issue with crag repl please? github.com/librasteve/raku-App-Crag/issues/13 | 19:03 | |
19:11
arkiuat joined
|
|||
SmokeMachine | librasteve_: www.irccloud.com/pastebin/85rQaqqt/ | 19:17 | |
librasteve_: www.irccloud.com/pastebin/8y3a36Gg/ | |||
19:19
abraxxa-home joined
|
|||
lizmat | librasteve answered | 19:23 | |
19:24
abraxxa-home left
19:25
abraxxa-home joined
|
|||
disbot4 | <librasteve> okaay - is the diff wrt some PR or branch? | 19:29 | |
lizmat | this is the change you should make in your code :-) | 19:30 | |
I was too lazy to make a PR | |||
disbot4 | <librasteve> (tx for quick response - I am just too thick to work out how to deploy it) | ||
<librasteve> .oO | |||
<librasteve> 2 mins | |||
lizmat | you could look at the diff's line numbers and just type in the changed lines ? | ||
19:32
melezhik left
|
|||
disbot4 | <librasteve> yay | 19:33 | |
<librasteve> released as 0.0.26 | |||
<librasteve> touché | 19:34 | ||
19:34
arkiuat left
|
|||
SmokeMachine | librasteve_: does that make sense? | 19:36 | |
disbot4 | <librasteve> tbh. I found the role definition code quite mysterious - I think that the Rails concept is much cleaner for user code - wouldnt it be easier for a user to write code with three models and two relationships? [or is there a subtle problem with that, possible deadlock maybe?] | 19:40 | |
19:47
arkiuat joined
|
|||
SmokeMachine | librasteve_: really, mysterious? It’s just a method with a join… | 19:48 | |
librasteve_ | www.irccloud.com/pastebin/0NSSY3gQ | 19:50 | |
^^ I thought maybe like this (untested) and sure that append is not a thing | |||
19:51
[Coke] left
|
|||
SmokeMachine | librasteve_: I don’t like the rails way because I think it assumes too much… that’s the reason on Red you have to declare the foreign key (is referencing) and the relationship… instead of declaring just the relationship and assume the fk… | 19:51 | |
19:51
arkiuat left
|
|||
disbot4 | <librasteve> yeah - that's fine ... sorry I just backtracked to your previous examples - L11, L18 and so on ... that;s perfect | 19:53 | |
19:53
[Coke] joined
|
|||
disbot4 | <librasteve> I dont think that this | 19:54 | |
SmokeMachine | But that code is not polymorphic, right? You have no relationship from comments to photo nor post… | ||
But you could add 2 pet gods there with joins to change that… | 19:55 | ||
If you add comment-id on post and photo, each one will only be able to have 1 comment | 19:57 | ||
disbot4 | <librasteve> 2 pet gods? | 20:01 | |
SmokeMachine | Sorry??? | ||
disbot4 | <librasteve> that's what you typed ^^ | ||
SmokeMachine | S/2 pet gods/2 join methods/ | 20:02 | |
disbot4 | <librasteve> lol | 20:03 | |
<librasteve> ok - so what I gather now is that we (both) think that the Rails polymorphic stuff is overkill and pet gods is the way to go | 20:05 | ||
<librasteve> ie Red has a tighter relationship with the database | 20:06 | ||
<librasteve> thanks for taking time to explain a bit more about Red to me ... so far (with HARC) it has been awesome! | 20:08 | ||
SmokeMachine | I don’t think polymorphic is overkill, but I don’t like the way Rails do that… and I would to everything I could to avoid the need of using that… we use that at work… it brings more problems than solutions… | ||
disbot4 | <librasteve> ok - you are the king of ORM - I will be less harsh on polymorphic as an idea - and more positive that the role example you supplied is a good way | 20:10 | |
<librasteve> nevertheless | |||
<librasteve> role Commentable { method comments { my $table = self.^table; self.^rs.join-model: :name<comments>, Comment, -> $entity, $comment { $entity.^id-hash.values.head == $comment.commentable-id && $comment.commentable-type eq $table } } } | 20:11 | ||
SmokeMachine | I agree that maybe we should have a way to do that with Red that looks more declarative… but I couldn’t find a better syntax… | ||
disbot4 | <librasteve> ^^ this implementation remains "mysterious" to me | ||
SmokeMachine | You don’t need to use a role… you could just declare the join methods inside the Post and Photo (as on the cookbook example) | 20:12 | |
disbot4 | <librasteve> are you defining a join table here (ie 2x columns with foreign keys) | ||
<librasteve> I like the idea of the join methods - but, as you said, that's not polymorphic | 20:13 | ||
SmokeMachine | The join method as exemplified on the cookbook and as the role is adding on Post and Photo IS polymorphic… | 20:15 | |
20:18
lichtkind left
|
|||
SmokeMachine | the polymorphic solution (if I understood correctly) is a way to a “foreign key” “point to more than one table”… so on the table that will have that fk (comment on this case) you have the “fk” (commendable-id) and what table it should point to (commentable-type). | 20:20 | |
I just had an idea… let me test that | |||
20:20
arkiuat joined
|
|||
disbot4 | <librasteve> i have been rereading the various comments - when you said "that code is not polymorphic" I now see that you meant my code and that the model Comment should reference out rather than the Post/Photo reference in - I misunderstood and thought that you meant your L11, L18 examples are not polymorphic | 20:24 | |
<librasteve> [I am doing a good impression of the "idiot savant"] | 20:25 | ||
<librasteve> sorry must &afk - really enjoyed our chat sorry to be so slow | 20:30 | ||
20:55
abraxxa-home left
21:30
arkiuat left
21:31
arkiuat joined
21:36
samebchase left,
samebchase joined
21:52
apa_c left
21:53
guifa joined
22:35
arkiuat left
22:41
arkiuat joined
22:46
arkiuat left
22:58
arkiuat joined
23:02
arkiuat left
23:08
deoac joined
23:09
wayland left
23:27
arkiuat joined
23:37
arkiuat left
23:47
dg joined
|