Modifying newest tweet selection.

This commit is contained in:
ruidajo 2022-05-03 20:50:20 -05:00
parent 35d9d037d3
commit a08073232d
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,4 @@
accessing
newestTweet
^ self messages newestOf: self id

View File

@ -0,0 +1,7 @@
accessing
newestOf: userId
self messages ifNil: [ ^ nil ].
self messages ifEmpty: [ ^ nil ].
^ ((self select: [ :tweet | tweet authorId = userId ])
select: [ :tweet | tweet created = (((self select: [ :each | each authorId = userId ]) collect: [ :each | each created ]) asSortedCollection last)]) first