# Prospective Feature: Highlight Posts That Surpass Defined "Likes" Threshold

**URL:** <https://meta.discourse.org/t/prospective-feature-highlight-posts-that-surpass-defined-likes-threshold/53945>\
**Category:** Feature\
**Created:** [7 Dicembre 2016, 11:44pm UTC](https://meta.discourse.org/t/prospective-feature-highlight-posts-that-surpass-defined-likes-threshold/53945 "2016-12-07T23:44:15Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![OnceWas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/oncewas/32/40734_2.png) [@OnceWas](https://meta.discourse.org/u/OnceWas)\
**Post date:** [8 Dicembre 2016, 3:22am UTC](https://meta.discourse.org/t/prospective-feature-highlight-posts-that-surpass-defined-likes-threshold/53945/9 "2016-12-08T03:22:53Z")

</div>

The query in the plugin targets a single post, and the behavior is modelled around a single result:

```
    most_liked_post = topic.posts.joins(user: [group_users:[:group]]).where(groups: {name: (params[:group].split("|"))}).where.not(sort_order: 1).order(like_count: :desc).limit(1).first

```

You could probably replace the `.limit(1).first` with a `.where(like_count:)` is greater than your likes threshold. However you would also have to strip out the link to the (single) top post.

---

_[View the full topic](https://meta.discourse.org/t/prospective-feature-highlight-posts-that-surpass-defined-likes-threshold/53945)._
