thanks
thanks copied to clipboard
users first, not releases
This is a really cool idea!
My first reaction when I browsed the page though was : too bad I have to browse within versions to get people names. It's obfuscating the main info: thanking people, not version numbers
What if the main view was a single list of names ? and for each one a list of version.
e.g.:
- John Doe (1.2.3, etc.)
My 2 cents
Yeah, I'm not 100% sure what should be on the home page, but a view like this, sort of the reverse of the "all time" page, would be good regardless of where it goes!
I need someone who's good at sql here; I have a branch with all of the work done except the query.
hear my prayers, oh based @sgrif 😜
let users = ...;
let commits = Commit::belonging_to(&users).grouped_by(&users);
let users_and_commits = users.into_iter().zip(commits);
let releases = releases.load::<Release>.into_iter()
.map(|release| (release.id, release)).collect::<HashMap<_, _>>;
users_and_commits.map(|(user, commits)| {
let release_names = commits.iter().map(|c| releases[c.release_id].version)
.collect::<Vec<_>>().join(", ");
format!("{}, ({})", user.name, release_names);
})
Something like that.
For future reference, you're supposed to say my name 3 times to summon me. :trollface:
Ah, interesting to see how you'd tackle this. Thanks so much ❤️
Could have let Diesel do the grouping of Releases too, but it'd result in a lot of unnecessary cloning.
Yeah, with more complex stuff like this, it's hard to tell what's better in the DB and what's better in Rust. I mean, we'll have so few entries here it doesn't matter either way....