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

Add feedback reviews to api #79

Merged

Conversation

KaemonIsland
Copy link

This PR adds feedback_reviews create, update, and destroy actions to respond to JSON requests.

New roles have been added for users to update and destroy their feedback_reviews.

Kaemon Lovendahl added 10 commits February 7, 2020 08:41
dependent was set on the belongs_to association for feedback_reviews
to destroy the review it belonged to. This would mean that if an individual
wanted to remove feedback, it would also remove the review it was attached to.
Seems pretty weird.

I moved the dependent: :destroy declaration to the Review model, so that
if a review is removed, it will remove all attached feedback.
Tests have been written for the api feedback_reviews controller.
This covers creating a feedback_review and only allowing one feedback_review
per user per review. The update and destroy actions are tested against other
users attempting to perform these actions on other instances.

The update and destroy actions have been added to CanCan ability.
So that users can update their own reviews without needing to be admin.
@ericsaupe ericsaupe merged commit 125b668 into solidusio-contrib:master Feb 25, 2020
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