Skip to content

Commit

Permalink
Use flat_map instead of map(...).flatten
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Aug 13, 2024
1 parent 4f329de commit 134ab57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,6 @@ def archive_user(archive_name)

def medium_ids_of_lectures_or_edited_lectures
lectures = given_lectures + edited_lectures
lectures.map(&:media_with_inheritance).flatten.pluck(:id)
lectures.flat_map(&:media_with_inheritance).pluck(:id)
end
end

0 comments on commit 134ab57

Please sign in to comment.