# (Ruby) Selecting only posts that are made by non-original posters

**URL:** <https://meta.discourse.org/t/ruby-selecting-only-posts-that-are-made-by-non-original-posters/157996>\
**Category:** Development\
**Created:** [July 17, 2020, 12:50am UTC](https://meta.discourse.org/t/ruby-selecting-only-posts-that-are-made-by-non-original-posters/157996 "2020-07-17T00:50:05Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ghgoodreau](https://avatars.discourse-cdn.com/v4/letter/g/7ba0ec/32.png) [@ghgoodreau](https://meta.discourse.org/u/ghgoodreau)\
**Post date:** [July 17, 2020, 12:50am UTC](https://meta.discourse.org/t/ruby-selecting-only-posts-that-are-made-by-non-original-posters/157996/1 "2020-07-17T00:50:05Z")

</div>

Hey everyone!

I have started volunteering for a community recently and I am tasked with updating an existing plugin. This plugin currently changes a topics tag when it reaches a certain word count threshold. I am supposed to convert this to only count words from posts in the topic that are not from the topic’s creator.

Currently, the word count is achieved by this snippet:

```
replies = topic.posts.where('post_number > 1')
reply_word_count = replies.sum(:word_count)

```

I’m thinking the strategy for this will be:

```
non_op_replies = topic.posts.where('post.user.username != topic.user.username')
reply_word_count = non_op_replies.sum(:word_count)

```

But this doesn’t seem to work. I have been fiddling around with the syntax for a while and can’t seem to get a working plugin out of it. I have been trying to find documentation for developing in Discourse with Ruby and I am coming up short. I would love if someone is able to help me out or point me in the right direction. I’m also new to Ruby so sorry in advance if it’s just a silly error.

---

_[View the full topic](https://meta.discourse.org/t/ruby-selecting-only-posts-that-are-made-by-non-original-posters/157996)._
