DEV: small refactor of the category_moderators method (PR #12550)

Used index_by(&:id) instead of map { |u| [, u] }.to_h thanks to @cvx’s recommendation.

Also renamed the moderators variable to not clash with method of the same name.


How about more code golf? :stuck_out_tongue:, mods.values_at(row.user_ids))
1 Like

Hm, that didn’t work as expected :eyes:

My bad, values_at accepts varargs, not an array:, mods.values_at(*row.user_ids))