Skip to content

Add overall_rating to Plantings #4062

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

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Conversation

CloCkWeRX
Copy link
Collaborator

@CloCkWeRX CloCkWeRX commented May 25, 2025

Fix #1504

This commit introduces an 'overall_rating' attribute to the Planting model, allowing you to rate your plantings on a scale of 1 to 5.

Key changes include:

  • Added overall_rating integer column to the plantings table with a database migration.
  • Implemented validation in the Planting model for overall_rating (integer, 1-5, allows blank).
  • Updated Planting form (new/edit) to include a select field for overall_rating.
  • Updated Planting show page to display the overall_rating if present.
  • Added schema.org Rating metadata (JSON-LD) to the Planting show page when a rating exists.
  • Updated the Harvest show page to display an alert prompting you to rate the associated planting if it hasn't been rated yet.
  • Added model and feature tests to cover the new functionality, including validations, UI changes, JSON-LD output, and the harvest rating prompt.

Note: I encountered an environment-specific database connection issue during development which hindered database migrations and test execution.

This commit introduces an 'overall_rating' attribute to the Planting model,
allowing you to rate your plantings on a scale of 1 to 5.

Key changes include:
- Added `overall_rating` integer column to the `plantings` table with a
  database migration.
- Implemented validation in the `Planting` model for `overall_rating`
  (integer, 1-5, allows blank).
- Updated Planting form (new/edit) to include a select field for
  `overall_rating`.
- Updated Planting show page to display the `overall_rating` if present.
- Added schema.org `Rating` metadata (JSON-LD) to the Planting show page
  when a rating exists.
- Updated the Harvest show page to display an alert prompting you to rate
  the associated planting if it hasn't been rated yet.
- Added model and feature tests to cover the new functionality, including
  validations, UI changes, JSON-LD output, and the harvest rating prompt.

Note: I encountered an environment-specific database connection issue during development which hindered database migrations and test execution.
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.

Rate a planting
1 participant