Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Report feature #953
Worked on the following tickets related to Issue #14:
The first step will be changing
reportee_idto integers in your migrations and report factory. Next, focus on associations. I've discussed examples from this Odin Project blog post in the comments below.
Ideally we should be able to open up the interactive console (`bin rails console) and do the following:
- Create a new report from our factory with
- Inspect that new Report with
Report.find(1)and see that it has integers for
- Get additional details about the reportee through our Report (which user submitted this report?).
Report.find(1).reportee_idshould return a User record
#<User id: 1, email: "email@example.com", …)
- Let's also answer the opposite question: How many reports has this user submitted?
User.find(1).submitted_reportsshould return an array of Reports info, like
#<Report:0x007fea65c840b8 id: 1, reporter_id: 1, reportee_id: 2, …
Great work so far! Excellent progress :)
Most of my feedback is stylistic, let me know if you have any questions!
Yay paired with Prateksha on resolving merge conflicts
Went through the PR again and found some things to fix, let me know if there are any questions.
Please also add a feature/acceptance test to test out the paths correctly.
E.g. Test out viewing a profile or comment, hitting report, and filling out the report.
user_id field in the Report model