Skip to content

AteqEjaz/spree_reviews

 
 

Repository files navigation

Reviews

Build Status Dependency Status Coverage Status

Straightforward review/rating facility.

Installation

Add to your Gemfile

gem 'spree_reviews', github: 'futhr/spree_reviews', branch: '2-0-stable'

Run

bundle install
rails g spree_reviews:install
rake db:migrate

Usage

Action submit in reviews controller - goes to review entry form

Users must be logged in to submit a review

Three partials:

  • ./app/views/products/_rating.html.erb -- display number of stars
  • ./app/views/products/_shortrating.html.erb -- shorter version of above
  • ./app/views/products/_review.html.erb -- display a single review

Administrator can edit and/or approve and/or delete reviews.

Implementation

Reviews table is quite obvious - and note the approved flag which is for the administrator to update. Ratings table holds current fractional value - avoids frequent recalc.

TODO

  • Partial(s) for selecting approved reviews to read
  • REST routes needed in some places?
  • Only accept ratings for approved reviews?
  • Allow stand alone rating values?

Discussion

Some points which might need modification in future:

  • I don't track the actual user on a review (just their "screen name" at the time), but we may want to use this information to avoid duplicate reviews etc.

  • Rating votes are tied to a review, to avoid spam. However: ratings are accepted whether or not the review is accepted. Perhaps they should only be counted when the review is approved.

Contributing

In the spirit of free software, everyone is encouraged to help improve this project.

Here are some ways you can contribute:

  • by using prerelease versions
  • by reporting bugs
  • by suggesting new features
  • by writing translations
  • by writing or editing documentation
  • by writing specifications
  • by writing code (no patch is too small: fix typos, add comments, clean up inconsistent whitespace)
  • by refactoring code
  • by resolving issues
  • by reviewing patches

Starting point:

  • Fork the repo
  • Clone your repo
  • Run bundle install
  • Run bundle exec rake test_app to create the test application in spec/test_app
  • Make your changes and follow this Style Guide
  • Ensure specs pass by running bundle exec rspec spec
  • Submit your pull request

Copyright (c) 2013 Paul Callaghan, released under the New BSD License

About

Basic review and ratings facility for Spree Commerce

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%