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

Chore: Adds project submission policy. #4349

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ZachBaird
Copy link
Contributor

Because

It limits what accounts can like project submissions. This PR is aimed at tackling accounts which were made to game the submission votes.

This PR

  • Restrains an account from upvoting a submission if it is less than 10 days old
  • Restrains an account from upvoting a submission if it the account hasn't submitted its own submission
  • Implements both constraints in a policy.

Issue

Closes #4121

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the keyword: brief description of change format, using one of the following keywords:
    • Feature - adds new or amends existing user-facing behavior
    • Chore - changes that have no user-facing value, refactors, dependency bumps, etc
    • Fix - bug fixes
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • I have verified all tests and linters pass after making these changes.
  • If this PR addresses an open issue, it is linked in the Issue section
  • If applicable, this PR includes new or updated automated tests

@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-4349 January 23, 2024 00:23 Inactive
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-4349 January 26, 2024 22:36 Inactive
Copy link
Member

@KevinMulhern KevinMulhern left a comment

Choose a reason for hiding this comment

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

Nice work @ZachBaird! this is looking solid. I've just got a bunch of minor things for feedback mate.

app/controllers/project_submissions/likes_controller.rb Outdated Show resolved Hide resolved
app/policies/submission_vote_policy.rb Outdated Show resolved Hide resolved
app/policies/submission_vote_policy.rb Outdated Show resolved Hide resolved
app/policies/submission_vote_policy.rb Outdated Show resolved Hide resolved
app/policies/submission_vote_policy.rb Outdated Show resolved Hide resolved
spec/system/lesson_project_submissions/like_spec.rb Outdated Show resolved Hide resolved
spec/system/lesson_project_submissions/like_spec.rb Outdated Show resolved Hide resolved
spec/system/lesson_project_submissions/like_spec.rb Outdated Show resolved Hide resolved
spec/system/lesson_project_submissions/like_spec.rb Outdated Show resolved Hide resolved
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-4349 May 8, 2024 12:31 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog / Ideas
Development

Successfully merging this pull request may close these issues.

Enhancement: Add user policy objects to limit errant submission votes.
2 participants