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

Replaced .count with .size in Line 49 #8491

Merged
merged 6 commits into from
Oct 12, 2020
Merged

Conversation

Annysah
Copy link
Contributor

@Annysah Annysah commented Oct 8, 2020

Fixes #8489 (<=== 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

Thanks!

@gitpod-io
Copy link

gitpod-io bot commented Oct 8, 2020

@codecov
Copy link

codecov bot commented Oct 8, 2020

Codecov Report

Merging #8491 into main will decrease coverage by 0.22%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8491      +/-   ##
==========================================
- Coverage   82.01%   81.79%   -0.23%     
==========================================
  Files         101      101              
  Lines        5894     5894              
==========================================
- Hits         4834     4821      -13     
- Misses       1060     1073      +13     
Impacted Files Coverage Δ
app/models/answer.rb 73.68% <0.00%> (-26.32%) ⬇️
app/models/answer_selection.rb 31.25% <0.00%> (-6.25%) ⬇️
app/services/execute_search.rb 88.88% <0.00%> (-5.56%) ⬇️
app/api/srch/search.rb 66.87% <0.00%> (-3.83%) ⬇️

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.

Great job here 💯 almost there

@@ -1,4 +1,4 @@
<div class="col-md-2">
m <div class="col-md-2">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like you added this m by mistake. Kindly edit the file and remove the m at the beginning of the file and commit.
you can find it here https://github.com/Annysah/plots2/blob/patch-6/app/views/search/all_content.html.erb.

@RuthNjeri
Copy link
Contributor

Good job @Annysah, I'm just curious if changing .count to .size also applied to the queries too? Since multiple models use .count.. @cesswairimu can confirm this?

@RuthNjeri
Copy link
Contributor

RuthNjeri commented Oct 9, 2020

Also, there are some files that have been left out in the view like
Form Partial
Card Partial and line 29

and some more..

If you use Visual Studio Code as an editor, you can search the word count and you'll see all the files that reference it, that's what I have done @Annysah, if you are not using Visual Studio Code, I think you can just do a global search within those files, or use the global search of your editor.

Screenshot 2020-10-09 at 21 08 21

@cesswairimu
Copy link
Collaborator

cesswairimu commented Oct 9, 2020

Yeah it applies to some of them, we have other issues opened for some of these files. sometimes .size does not replace .count seamlessly e.g on this line https://github.com/publiclab/plots2/blob/main/app/models/node.rb#L197 using .size returns nil but .count returns 0. That's why replacing a couple of files per issue is crucial so that we don't break existing functionality. Hope this answers your question Thanks

@RuthNjeri
Copy link
Contributor

It's clear now, thanks @cesswairimu

@codeclimate
Copy link

codeclimate bot commented Oct 10, 2020

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

View more on Code Climate.

@Annysah
Copy link
Contributor Author

Annysah commented Oct 10, 2020

Hello @cesswairimu thanks for the review, I have removed the m which was mistakenly added.
Can I get a review?

@Annysah
Copy link
Contributor Author

Annysah commented Oct 10, 2020

Thanks @RuthNjeri

Copy link
Collaborator

@Tlazypanda Tlazypanda left a comment

Choose a reason for hiding this comment

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

@Annysah Looking good 🎉 Thanks for working on this!!

@Annysah
Copy link
Contributor Author

Annysah commented Oct 11, 2020

Thank you! @Tlazypanda

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.

Awesome all good now 🎉

@cesswairimu
Copy link
Collaborator

cesswairimu commented Oct 12, 2020

Thanks @Annysah for working on this 🚀 would you like to close the other pull requests since we updated all files here?
Thanks @Tlazypanda for the review 🎉

@cesswairimu cesswairimu merged commit 6066701 into publiclab:main Oct 12, 2020
@welcome
Copy link

welcome bot commented Oct 12, 2020

Congrats on merging your first pull request! 🙌🎉⚡️
Your code will likely be published to PublicLab.org in the next few days, but first it will be published to https://stable.publiclab.org/ (it will take some minutes for this to load, and until then you may see logs from the build process). Please test out your work on this testing server and report back with a comment that all has gone well!
Do join our weekly check-in to share your this week goal and the awesome work you did 😃. Please find the link pinned in the issue section 📝
Now that you've completed this, you can help someone else take their first step!
Reach out to someone else working on theirs on Public Lab's code welcome page (where you'll now be featured as a recent contributor!). Thanks!

Help others take their first step

Now that you've merged your first pull request, you're the perfect person to help someone else out with this challenging first step. 🙌

https://code.publiclab.org

Try looking at this list of `first-timers-only` issues, and see if someone else is waiting for feedback, or even stuck! 😕

People often get stuck at the same steps, so you might be able to help someone get unstuck, or help lead them to some documentation that'd help. Reach out and be encouraging and friendly! 😄 🎉

Read about how to help support another newcomer here, or find other ways to offer mutual support here.

@cesswairimu
Copy link
Collaborator

cesswairimu commented Oct 12, 2020

NM, closed them. Thanks everyone

@Annysah
Copy link
Contributor Author

Annysah commented Oct 12, 2020

Oh my!!! I'm so excited that my PR was merged!!!
Thank you so much! @cesswairimu

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.

Replace .count on app/views/search to .size
4 participants