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

Fixes #7831. Fixed filter spam tags in app/controllers/stats_controller.rb #7851

Merged
merged 4 commits into from
May 3, 2020
Merged

Fixes #7831. Fixed filter spam tags in app/controllers/stats_controller.rb #7851

merged 4 commits into from
May 3, 2020

Conversation

dongskyler
Copy link
Member

Fixes #7831. (<=== Add issue number here)

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

@cesswairimu

Thanks!

@codecov
Copy link

codecov bot commented Apr 29, 2020

Codecov Report

Merging #7851 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7851   +/-   ##
=======================================
  Coverage   82.05%   82.05%           
=======================================
  Files          97       97           
  Lines        5645     5645           
=======================================
  Hits         4632     4632           
  Misses       1013     1013           
Impacted Files Coverage Δ
app/controllers/stats_controller.rb 74.19% <100.00%> (ø)

@@ -1,7 +1,7 @@
class StatsController < ApplicationController
def subscriptions
@tags = {}
TagSelection.where(following: true).each do |tag|
TagSelection.joins(:node_tags).where(following: true).each do |tag|
Copy link
Collaborator

@cesswairimu cesswairimu Apr 30, 2020

Choose a reason for hiding this comment

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

Thanks for working on this so quick @dongskyler 🎉 ...we want this to become TagSelection.where(following: true) .joins(:node_tags) as explained in this comment #7831 (comment)

Copy link
Member Author

@dongskyler dongskyler Apr 30, 2020

Choose a reason for hiding this comment

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

@cesswairimu

I’m happy to work on it shortly.

But to be clear, this calls for another branch and another PR, and it will void my previous PR. This was not what I modified in my previous branch.

Copy link
Collaborator

@cesswairimu cesswairimu Apr 30, 2020

Choose a reason for hiding this comment

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

Not really...we are moving the 'join' after the 'where'..
in the previous PR we had TagSelection.joins(:node_tags).where(following: true) and before that we did not have the join to node_tags...makes sense?

Copy link
Member Author

Choose a reason for hiding this comment

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

I misunderstood what you instructed me to do.

I have updated the branch and both tests have passed.

Please review.

@cesswairimu
Copy link
Collaborator

hey, I can't see the changes on the files changes maybe you deleted that commit..kindly check. Thanks

@cesswairimu cesswairimu merged commit 6d1744a into publiclab:master May 3, 2020
@dongskyler
Copy link
Member Author

hey, I can't see the changes on the files changes maybe you deleted that commit..kindly check. Thanks

I'm sorry I didn't fix the issue right away.

@cesswairimu
Copy link
Collaborator

No worries...thanks for woking on this @dongskyler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter spam tags from /stats/subscriptions
2 participants