Refactoring coauthored notes query into a method in User.rb #1793
Labels
enhancement
explains that the issue is to improve upon one of our existing features
first-timers-only
They need to be well-formatted using the First-timers_Issue_Template.
help wanted
requires help by anyone willing to contribute
Ruby
testing
issues are usually for adding unit tests, integration tests or any other tests for a feature
Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.
If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!
We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝
If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!
🤔 What you will need to know.
Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.
📋 Step by Step
PROBLEM :
We need to Refactor the Coauthored notes query (soon to be used on profile pages like this to display posts an author has assisted with) into a method in the
User.rb
model (/app/models/user.rb
) and to write a Unit test for it (in/test/unit/user_test.rb
).SOLUTION :
The query is given here :
plots2/app/controllers/users_controller.rb
Line 111 in de29744
The above query should be moved into the
user.rb
model as :And the test for the above query goes here -- you can see other examples of tests in this file too:
test/unit/user_test.rb
Thank you!
Your help makes Public Lab better! We deeply appreciate your helping refine and improve this site.
To learn how to write really great issues, which increases the chances they'll be resolved, see:
https://publiclab.org/wiki/developers#Contributing+for+non-coders
The text was updated successfully, but these errors were encountered: