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

Ability to like (vote) on changelogs #264

Merged
merged 7 commits into from
Jan 17, 2024
Merged

Ability to like (vote) on changelogs #264

merged 7 commits into from
Jan 17, 2024

Conversation

Autive
Copy link
Contributor

@Autive Autive commented Jan 16, 2024

This adds the ability to like/vote on changelogs as suggested in #205.

@Cannonb4ll
Copy link
Contributor

So while this is great, it is double work. We already have a votes table that is polymorphic.

You can see that here: https://github.com/ploi/roadmap/blob/main/app/Traits/HasUpvote.php#L17

It's just a matter of applying the trait to your model (in this case Changelog.php) and using the available methods from that trait.

It saves another table creation, and everything else is already saved in that table automatically by calling the toggleUpvote() method. (https://github.com/ploi/roadmap/blob/main/app/Traits/HasUpvote.php#L31)

Item.php model has this: https://github.com/ploi/roadmap/blob/main/app/Models/Item.php#L25
Comment.php model has this: https://github.com/ploi/roadmap/blob/main/app/Models/Comment.php#L15

@Autive
Copy link
Contributor Author

Autive commented Jan 16, 2024

Didn't notice that, Changed the PR to move this to the Upvote Trait.

@Cannonb4ll Cannonb4ll merged commit a854281 into ploi:main Jan 17, 2024
4 checks passed
@Cannonb4ll
Copy link
Contributor

🥰

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.

2 participants