Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter Banned Users from User Reactions (Fixes #8618) #8875

Merged
merged 6 commits into from
Dec 21, 2020

Conversation

noi5e
Copy link
Contributor

@noi5e noi5e commented Dec 20, 2020

(Fixes #8618).

  • Changes the Rails ActiveRecord query when looking up user_reactions_map for displaying comment reactions.
    • Now, it filters out users with status = 0.
    • Please take a look at the query, I'm still learning how to write these properly.
  • Writes a new unit test for comments showing that banned users are filtered from user reactions.
  • I had to make additional changes to the like method in comment_controller.rb.
    • When a user likes a comment, the server sends an updated version of the comment's likes
    • So I had to make sure these likes were also filtered for banned users.

This was fun to figure out! It taught me a lot about queries and comments in general.

@noi5e noi5e requested a review from a team as a code owner December 20, 2020 01:33
@gitpod-io
Copy link

gitpod-io bot commented Dec 20, 2020

@codecov
Copy link

codecov bot commented Dec 20, 2020

Codecov Report

❗ No coverage uploaded for pull request base (main@ff3417a). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8875   +/-   ##
=======================================
  Coverage        ?   81.85%           
=======================================
  Files           ?      100           
  Lines           ?     5935           
  Branches        ?        0           
=======================================
  Hits            ?     4858           
  Misses          ?     1077           
  Partials        ?        0           

@codeclimate
Copy link

codeclimate bot commented Dec 20, 2020

Code Climate has analyzed commit eeb544f and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Collaborator

@cesswairimu cesswairimu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic 🎉 🎉 thanks for sticking with this @noi5e 🚀

@cesswairimu cesswairimu merged commit 6505f53 into publiclab:main Dec 21, 2020
@noi5e noi5e deleted the bug/remove-banned-user-emojis branch December 21, 2020 19:02
@noi5e
Copy link
Contributor Author

noi5e commented Dec 27, 2020

Referencing this so it appears in my planning issue #9069

@noi5e noi5e changed the title Filter Banned Users from User Reactions (Fixes #8618) Bug: Filter Banned Users from User Reactions (Fixes #8618) Dec 27, 2020
@noi5e noi5e changed the title Bug: Filter Banned Users from User Reactions (Fixes #8618) Filter Banned Users from User Reactions (Fixes #8618) Jan 23, 2021
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
…clab#8875)

* filter banned users from likes (publiclab#8618)

* tweak ref to user_reactions_map (publiclab#8618)

* change user_reactions_map structure (publiclab#8618)

* filter banned users from user reactions (publiclab#8618)

* change IS NOT query to != (publiclab#8618)

* change IS NOT query to != (publiclab#8618)
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
…clab#8875)

* filter banned users from likes (publiclab#8618)

* tweak ref to user_reactions_map (publiclab#8618)

* change user_reactions_map structure (publiclab#8618)

* filter banned users from user reactions (publiclab#8618)

* change IS NOT query to != (publiclab#8618)

* change IS NOT query to != (publiclab#8618)
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
…clab#8875)

* filter banned users from likes (publiclab#8618)

* tweak ref to user_reactions_map (publiclab#8618)

* change user_reactions_map structure (publiclab#8618)

* filter banned users from user reactions (publiclab#8618)

* change IS NOT query to != (publiclab#8618)

* change IS NOT query to != (publiclab#8618)
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
…clab#8875)

* filter banned users from likes (publiclab#8618)

* tweak ref to user_reactions_map (publiclab#8618)

* change user_reactions_map structure (publiclab#8618)

* filter banned users from user reactions (publiclab#8618)

* change IS NOT query to != (publiclab#8618)

* change IS NOT query to != (publiclab#8618)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove emoji left by banned user accounts
2 participants