Skip to content

Commit a503b00

Browse files
committed
inlined pinged_user_ids helper into pinged_users as it's used only once
1 parent ef3fa77 commit a503b00

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

app/helpers/comments_helper.rb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,11 @@ def comment_user_link(comment)
3434
user_link(comment.user, { host: comment.community.host })
3535
end
3636

37-
# Gets a list of pinged user IDs from a given content
38-
# @param content [String] content to get pinged user IDs from
39-
# @return [Array<String>] list of pinged user IDs
40-
def pinged_user_ids(content)
41-
content.scan(/@#(\d+)/).map { |g| g[0].to_i }
42-
end
43-
4437
# Gets a list of pinged users for a given content
4538
# @param content [String] content to get pinged users from
4639
# @return [Hash{String => User}] list of pinged users
4740
def pinged_users(content)
48-
user_ids = pinged_user_ids(content)
41+
user_ids = content.scan(/@#(\d+)/).map { |g| g[0].to_i }
4942
User.where(id: user_ids).to_a.to_h { |u| [u.id, u] }
5043
end
5144

0 commit comments

Comments
 (0)