You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fernando Correa de Oliveira edited this page Jul 7, 2020
·
2 revisions
model Person { ... }
model Track {
has UInt $!id is serial;
has UInt $!person-id is referencing( *.name, :model );
has Person $.person is relationship{ .person-id };
has Instant $.time is column;
}
model Person {
has Str $.name is id;
has @.tracks is relationship( *.person-id, :model);
method total {
@!tracks.sort(*.time).batch(2).map({ .[1].time - .[0].time }).sum
}
}