Coder Social home page Coder Social logo

spree-contrib / spree_reviews Goto Github PK

View Code? Open in Web Editor NEW
125.0 32.0 271.0 707 KB

Straightforward review/rating functionality.

Home Page: http://spreecommerce.org

License: BSD 3-Clause "New" or "Revised" License

Ruby 73.75% JavaScript 1.21% HTML 25.03%
spree ruby review

spree_reviews's Introduction

Reviews

Build Status Code Climate

Straightforward review/rating functionality.


Installation

Spree >= 3.1

gem 'spree_reviews', github: 'spree-contrib/spree_reviews'

Spree 3.0 and Spree 2.x

gem 'spree_reviews', github: 'spree-contrib/spree_reviews', branch: 'X-X-stable'

The branch option is important: it must match the version of Spree you're using. For example, use 3-0-stable if you're using Spree 3-0-stable or any 3.0.x version.

Now bundle up with:

bundle

Next, run the rake task that copies the necessary migrations and assets to your project:

bundle exec rails g spree_reviews:install

And finish with a migrate:

bundle exec rake db:migrate

Now you should be able to boot up your server with:

bundle exec rails s

That's all!


Usage

Action "submit" in "reviews" controller - goes to review entry form

Users must be logged in to submit a review

Three partials:

  • app/views/spree/products/_rating.html.erb -- display number of stars
  • app/views/spree/products/_shortrating.html.erb -- shorter version of above
  • app/views/spree/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...


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. See #18
  • 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

See corresponding contributing guidelines.


Copyright (c) 2009-2021 Spree Commerce and contributors, released under the New BSD License

spree_reviews's People

Contributors

alexey-chernikov avatar alexshuhin avatar citrus avatar damianlegawiec avatar dmasur avatar fabien avatar futhr avatar hnatt avatar iloveitaly avatar jdutil avatar johanb avatar joshk avatar jumph4x avatar lbrapid avatar matthewkennedy avatar minustehbare avatar parallel588 avatar paulcc avatar petergoldstein avatar poudelprakash avatar priyank-gupta avatar radar avatar rafalcymerys avatar relu avatar romul avatar schof avatar siarhei-hanchuk avatar tauil avatar thogg4 avatar uranazo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spree_reviews's Issues

Support for Spree 3.4.4

Hey All,

I've been wrestling with getting this to work on what I assume is not a supported version of spree using
gem 'spree_reviews', github: 'spree-contrib/spree_reviews', branch: 'master'

I was able to add the gem, and run the install task, but my application is having trouble finding the linked stylesheet and javascript file:
couldn't find file 'spree/frontend/spree_auth' with type 'application/javascript'
image
I'm assuming it is because spree uses spree_auth_devise now, but that is a wild shot in the dark.

Any ideas on how to fix the gem/application to support my version of spree?

Here is my full application trace:

/Users/zerocool/.rvm/gems/ruby-2.4.2/bundler/gems/spree_reviews-5e7965f18d06/app/assets/javascripts/spree/frontend/spree_reviews.js:3
sprockets (3.7.2) lib/sprockets/resolve.rb:65:in `resolve!'
sprockets (3.7.2) lib/sprockets/directive_processor.rb:399:in `resolve'
sprockets (3.7.2) lib/sprockets/directive_processor.rb:207:in `process_require_directive'
sprockets (3.7.2) lib/sprockets/directive_processor.rb:180:in `block in process_directives'
sprockets (3.7.2) lib/sprockets/directive_processor.rb:178:in `each'
sprockets (3.7.2) lib/sprockets/directive_processor.rb:178:in `process_directives'
sprockets (3.7.2) lib/sprockets/directive_processor.rb:83:in `_call'
sprockets (3.7.2) lib/sprockets/directive_processor.rb:68:in `call'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.7.2) lib/sprockets/loader.rb:134:in `load_from_unloaded'
sprockets (3.7.2) lib/sprockets/loader.rb:60:in `block in load'
sprockets (3.7.2) lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
sprockets (3.7.2) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.2) lib/sprockets/bundle.rb:23:in `block in call'
sprockets (3.7.2) lib/sprockets/utils.rb:200:in `dfs'
sprockets (3.7.2) lib/sprockets/bundle.rb:24:in `call'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.7.2) lib/sprockets/loader.rb:134:in `load_from_unloaded'
sprockets (3.7.2) lib/sprockets/loader.rb:60:in `block in load'
sprockets (3.7.2) lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
sprockets (3.7.2) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.2) lib/sprockets/base.rb:66:in `find_asset'
sprockets (3.7.2) lib/sprockets/base.rb:73:in `find_all_linked_assets'
sprockets (3.7.2) lib/sprockets/manifest.rb:142:in `block in find'
sprockets (3.7.2) lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
sprockets (3.7.2) lib/sprockets/path_utils.rb:228:in `block in stat_tree'
sprockets (3.7.2) lib/sprockets/path_utils.rb:212:in `block in stat_directory'
sprockets (3.7.2) lib/sprockets/path_utils.rb:209:in `each'
sprockets (3.7.2) lib/sprockets/path_utils.rb:209:in `stat_directory'
sprockets (3.7.2) lib/sprockets/path_utils.rb:227:in `stat_tree'
sprockets (3.7.2) lib/sprockets/path_utils.rb:231:in `block in stat_tree'
sprockets (3.7.2) lib/sprockets/path_utils.rb:212:in `block in stat_directory'
sprockets (3.7.2) lib/sprockets/path_utils.rb:209:in `each'
sprockets (3.7.2) lib/sprockets/path_utils.rb:209:in `stat_directory'
sprockets (3.7.2) lib/sprockets/path_utils.rb:227:in `stat_tree'
sprockets (3.7.2) lib/sprockets/path_utils.rb:231:in `block in stat_tree'
sprockets (3.7.2) lib/sprockets/path_utils.rb:212:in `block in stat_directory'
sprockets (3.7.2) lib/sprockets/path_utils.rb:209:in `each'
sprockets (3.7.2) lib/sprockets/path_utils.rb:209:in `stat_directory'
sprockets (3.7.2) lib/sprockets/path_utils.rb:227:in `stat_tree'
sprockets (3.7.2) lib/sprockets/legacy.rb:105:in `each'
sprockets (3.7.2) lib/sprockets/legacy.rb:105:in `block in logical_paths'
sprockets (3.7.2) lib/sprockets/legacy.rb:104:in `each'
sprockets (3.7.2) lib/sprockets/legacy.rb:104:in `logical_paths'
sprockets (3.7.2) lib/sprockets/manifest.rb:140:in `find'
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:50:in `each'
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:50:in `map'
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:50:in `precompiled_assets'
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:35:in `asset_precompiled?'
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:251:in `block (3 levels) in <class:Railtie>'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:359:in `precompiled?'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:363:in `raise_unless_precompiled_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:337:in `digest_path'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:325:in `asset_path'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:102:in `block in resolve_asset_path'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:242:in `block in resolve_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `each'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `detect'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `resolve_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:101:in `resolve_asset_path'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:79:in `compute_asset_path'
actionview (5.1.6.2) lib/action_view/helpers/asset_url_helper.rb:198:in `asset_path'
actionview (5.1.6.2) lib/action_view/helpers/asset_url_helper.rb:373:in `image_path'
actionview (5.1.6.2) lib/action_view/helpers/asset_tag_helper.rb:194:in `favicon_link_tag'
spree_frontend (3.4.4) app/views/spree/shared/_head.html.erb:7:in `_23d615788b8b214c20f748dcb9292146'
actionview (5.1.6.2) lib/action_view/template.rb:157:in `block in render'
activesupport (5.1.6.2) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.1.6.2) lib/action_view/template.rb:352:in `instrument_render_template'
actionview (5.1.6.2) lib/action_view/template.rb:155:in `render'
deface (1.3.2) lib/deface/action_view_extensions.rb:41:in `render'
actionview (5.1.6.2) lib/action_view/renderer/partial_renderer.rb:342:in `block in render_partial'
actionview (5.1.6.2) lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
activesupport (5.1.6.2) lib/active_support/notifications.rb:166:in `block in instrument'
activesupport (5.1.6.2) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.1.6.2) lib/active_support/notifications.rb:166:in `instrument'
actionview (5.1.6.2) lib/action_view/renderer/abstract_renderer.rb:41:in `instrument'
actionview (5.1.6.2) lib/action_view/renderer/partial_renderer.rb:331:in `render_partial'
actionview (5.1.6.2) lib/action_view/renderer/partial_renderer.rb:310:in `render'
actionview (5.1.6.2) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionview (5.1.6.2) lib/action_view/renderer/renderer.rb:21:in `render'
actionview (5.1.6.2) lib/action_view/helpers/rendering_helper.rb:32:in `render'
app/views/spree/layouts/spree_application.html.erb:9:in `_231b6705ae8fdcce6a234e2d326c6b92'
actionview (5.1.6.2) lib/action_view/template.rb:157:in `block in render'
activesupport (5.1.6.2) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.1.6.2) lib/action_view/template.rb:352:in `instrument_render_template'
actionview (5.1.6.2) lib/action_view/template.rb:155:in `render'
deface (1.3.2) lib/deface/action_view_extensions.rb:41:in `render'
actionview (5.1.6.2) lib/action_view/renderer/template_renderer.rb:64:in `render_with_layout'
actionview (5.1.6.2) lib/action_view/renderer/template_renderer.rb:50:in `render_template'
actionview (5.1.6.2) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (5.1.6.2) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (5.1.6.2) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (5.1.6.2) lib/action_view/rendering.rb:103:in `_render_template'
actionpack (5.1.6.2) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (5.1.6.2) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (5.1.6.2) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.1.6.2) lib/action_controller/metal/renderers.rb:141:in `render_to_body'
actionpack (5.1.6.2) lib/abstract_controller/rendering.rb:24:in `render'
actionpack (5.1.6.2) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.1.6.2) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (5.1.6.2) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/zerocool/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
activesupport (5.1.6.2) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (5.1.6.2) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (5.1.6.2) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (5.1.6.2) lib/active_record/railties/controller_runtime.rb:29:in `cleanup_view_runtime'
actionpack (5.1.6.2) lib/action_controller/metal/instrumentation.rb:43:in `render'
actionpack (5.1.6.2) lib/action_controller/metal/implicit_render.rb:33:in `default_render'
actionpack (5.1.6.2) lib/action_controller/metal/basic_implicit_render.rb:4:in `block in send_action'
actionpack (5.1.6.2) lib/action_controller/metal/basic_implicit_render.rb:4:in `tap'
actionpack (5.1.6.2) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.1.6.2) lib/abstract_controller/base.rb:186:in `process_action'
actionpack (5.1.6.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.1.6.2) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.1.6.2) lib/active_support/callbacks.rb:131:in `run_callbacks'
actionpack (5.1.6.2) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.1.6.2) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.1.6.2) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.1.6.2) lib/active_support/notifications.rb:166:in `block in instrument'
activesupport (5.1.6.2) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.1.6.2) lib/active_support/notifications.rb:166:in `instrument'
actionpack (5.1.6.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.1.6.2) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
activerecord (5.1.6.2) lib/active_record/railties/controller_runtime.rb:22:in `process_action'
actionpack (5.1.6.2) lib/abstract_controller/base.rb:124:in `process'
actionview (5.1.6.2) lib/action_view/rendering.rb:30:in `process'
actionpack (5.1.6.2) lib/action_controller/metal.rb:189:in `dispatch'
actionpack (5.1.6.2) lib/action_controller/metal.rb:253:in `dispatch'
actionpack (5.1.6.2) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (5.1.6.2) lib/action_dispatch/routing/route_set.rb:31:in `serve'
actionpack (5.1.6.2) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.6.2) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.6.2) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.6.2) lib/action_dispatch/routing/route_set.rb:844:in `call'
railties (5.1.6.2) lib/rails/engine.rb:522:in `call'
railties (5.1.6.2) lib/rails/railtie.rb:185:in `public_send'
railties (5.1.6.2) lib/rails/railtie.rb:185:in `method_missing'
actionpack (5.1.6.2) lib/action_dispatch/routing/mapper.rb:17:in `block in <class:Constraints>'
actionpack (5.1.6.2) lib/action_dispatch/routing/mapper.rb:46:in `serve'
actionpack (5.1.6.2) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.6.2) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.6.2) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.6.2) lib/action_dispatch/routing/route_set.rb:844:in `call'
versioncake (3.3.0) lib/versioncake/rack/middleware.rb:17:in `call'
omniauth (1.8.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.8.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.8.1) lib/omniauth/builder.rb:63:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (2.0.6) lib/rack/etag.rb:25:in `call'
rack (2.0.6) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.6) lib/rack/head.rb:12:in `call'
rack (2.0.6) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.6) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.6.2) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.1.6.2) lib/active_record/migration.rb:556:in `call'
actionpack (5.1.6.2) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.6.2) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.6.2) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.6.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
airbrake (7.2.1) lib/airbrake/rack/middleware.rb:52:in `call'
actionpack (5.1.6.2) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.1.6.2) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.6.2) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.6.2) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.6.2) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.6.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.6.2) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.6.2) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.6.2) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.6.2) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.6) lib/rack/method_override.rb:22:in `call'
rack (2.0.6) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.6.2) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.6.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.6.2) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.6) lib/rack/sendfile.rb:111:in `call'
webpacker (3.3.1) lib/webpacker/dev_server_proxy.rb:18:in `perform_request'
rack-proxy (0.6.4) lib/rack/proxy.rb:57:in `call'
railties (5.1.6.2) lib/rails/engine.rb:522:in `call'
puma (3.10.0) lib/puma/configuration.rb:225:in `call'
puma (3.10.0) lib/puma/server.rb:605:in `handle_request'
puma (3.10.0) lib/puma/server.rb:437:in `process_client'
puma (3.10.0) lib/puma/server.rb:301:in `block in run'
puma (3.10.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread'

Deleting a review deletes the product it belongs to

In models/spree/review.rb at line 2:
belongs_to :product, touch: true, dependent: :destroy

This causes the product to be deleted when the review is deleted from the admin interface. If there are multiple reviews for a product, the other ones remain "hanging". I don't think deleting the product along with the review is a desired behavior.

Thank you,
Calin

Usage steps not clear

Please help me to use this gem/engine with proper guidelines. How to include those shared partials into my original app.

Thanks!

undefined method `txt_stars'

When I try to user the _rating.html.erb partial I get the following error:

undefined method `txt_stars'

This is the way I'm using the partial in my app:

# /overrides/spree/shared/products/_products/products_list_item.html.haml

/ replace_contents "[data-hook='products_list_item']"
...
= render partial: "spree/shared/rating", locals: {product: product}
...

It looks like the helpers of the spree_reviews engine are not correctly loaded or something.

Can somebody help?

undefined method `feedback_review_path' problem

Hello I am using 2.1-stable version. after I add my first review and approve it. I got this error when I view the product that has been reviewed. Any ideas?

Showing /home/chris/.rvm/gems/ruby-2.0.0-p0/bundler/gems/spree_reviews-59896be98b22/app/views/spree/feedback_reviews/_form.html.erb where line #2 raised:

undefined method `feedback_review_path' for #<#Class:0xdf36fa8:0xdd28f54>

Backend Spree::Reviews#index Eager Loading

Doesn't look or work very well in current state.

  CACHE (0.0ms)  SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 1068500386 LIMIT 1
  Spree::Product Load (0.5ms)  SELECT `spree_products`.* FROM `spree_products` WHERE `spree_products`.`id` = 1060504097 LIMIT 1
   (0.3ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 467
  CACHE (0.0ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 467
  CACHE (0.0ms)  SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 1068500386 LIMIT 1
  Spree::Product Load (0.4ms)  SELECT `spree_products`.* FROM `spree_products` WHERE `spree_products`.`id` = 1060537708 LIMIT 1
   (0.3ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 466
  CACHE (0.0ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 466
  CACHE (0.0ms)  SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 1068500386 LIMIT 1
  Spree::Product Load (0.4ms)  SELECT `spree_products`.* FROM `spree_products` WHERE `spree_products`.`id` = 1060503710 LIMIT 1
   (0.3ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 465
  CACHE (0.0ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 465
  CACHE (0.0ms)  SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 1068536727 LIMIT 1
  Spree::Product Load (0.4ms)  SELECT `spree_products`.* FROM `spree_products` WHERE `spree_products`.`id` = 1060544575 LIMIT 1
   (0.3ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 464
  CACHE (0.0ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 464
  CACHE (0.0ms)  SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 1068536727 LIMIT 1
  CACHE (0.0ms)  SELECT `spree_products`.* FROM `spree_products` WHERE `spree_products`.`id` = 1060538121 LIMIT 1
   (0.4ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 463
  CACHE (0.0ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 463
  CACHE (0.0ms)  SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 1068536727 LIMIT 1
  Spree::Product Load (0.4ms)  SELECT `spree_products`.* FROM `spree_products` WHERE `spree_products`.`id` = 1060535668 LIMIT 1
   (0.3ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 462
  CACHE (0.0ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 462
  CACHE (0.0ms)  SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 1068536727 LIMIT 1
  Spree::Product Load (0.5ms)  SELECT `spree_products`.* FROM `spree_products` WHERE `spree_products`.`id` = 1060537940 LIMIT 1
   (4.8ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 461
  CACHE (0.0ms)  SELECT COUNT(*) FROM `spree_feedback_reviews` WHERE `spree_feedback_reviews`.`review_id` = 461
  CACHE (0.0ms)  SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 1068536727 LIMIT 1
  CACHE (0.0ms)  SELECT `spree_products`.* FROM `spree_products` WHERE `spree_products`.`id` = 1060542686 LIMIT 1

Reminder to self.

Migrations failure

funkdified@funktop ~/rails_projects/hearingtracker $ rails g spree_reviews:install
append vendor/assets/javascripts/spree/frontend/all.js
append vendor/assets/javascripts/spree/backend/all.js
insert vendor/assets/stylesheets/spree/frontend/all.css
run bundle exec rake railties:install:migrations FROM=spree_reviews from "."
NOTE: Migration 20081020220724_create_reviews.rb from spree_reviews has been skipped. Migration with the same name already exists.
Copied migration 20140810181341_create_feedback_reviews.spree_reviews.rb from spree_reviews
Copied migration 20140810181342_add_rating_to_products.spree_reviews.rb from spree_reviews
Copied migration 20140810181343_add_user_to_reviews.spree_reviews.rb from spree_reviews
Copied migration 20140810181344_add_ip_address_to_reviews.spree_reviews.rb from spree_reviews
Copied migration 20140810181345_namespace_tables.spree_reviews.rb from spree_reviews
Copied migration 20140810181346_recalculate_ratings.spree_reviews.rb from spree_reviews
Copied migration 20140810181347_add_locale_to_reviews.spree_reviews.rb from spree_reviews
Copied migration 20140810181348_add_locale_to_feedback_reviews.spree_reviews.rb from spree_reviews
Would you like to run the migrations now? [Y/n] y
run bundle exec rake db:migrate from "."
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
== 20140810181341 CreateFeedbackReviews: migrating ============================
-- create_table(:feedback_reviews)
-> 0.0168s
-- add_index(:feedback_reviews, :review_id)
-> 0.0205s
-- add_index(:feedback_reviews, :user_id)
-> 0.0194s
== 20140810181341 CreateFeedbackReviews: migrated (0.0571s) ===================

== 20140810181342 AddRatingToProducts: migrating ==============================
-- table_exists?("products")
-> 0.0037s
-- table_exists?("spree_products")
-> 0.0017s
-- add_column(:spree_products, :avg_rating, :decimal, {:default=>0.0, :null=>false, :precision=>7, :scale=>5})
-> 0.0278s
-- add_column(:spree_products, :reviews_count, :integer, {:default=>0, :null=>false})
-> 0.0230s
== 20140810181342 AddRatingToProducts: migrated (0.0566s) =====================

== 20140810181343 AddUserToReviews: migrating =================================
-- add_column(:reviews, :user_id, :integer, {:null=>true})
-> 0.0304s
== 20140810181343 AddUserToReviews: migrated (0.0306s) ========================

== 20140810181344 AddIpAddressToReviews: migrating ============================
-- add_column(:reviews, :ip_address, :string)
-> 0.0245s
== 20140810181344 AddIpAddressToReviews: migrated (0.0246s) ===================

== 20140810181345 NamespaceTables: migrating ==================================
-- rename_table(:reviews, :spree_reviews)
-> 0.0052s
-- rename_table(:feedback_reviews, :spree_feedback_reviews)
-> 0.0722s
== 20140810181345 NamespaceTables: migrated (0.0776s) =========================

== 20140810181346 RecalculateRatings: migrating ===============================
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Unknown column 'spree_reviews.product_id' in 'on clause': SELECT spree_products.* FROM spree_products INNER JOIN spree_reviews ON spree_reviews.product_id = spree_products.id WHERE spree_products.deleted_at IS NULL AND (spree_reviews.id IS NOT NULL) ORDER BY spree_products.id ASC LIMIT 1000/home/funkdified/.rvm/gems/[email protected]/gems/activerecord-4.1.4/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:in `query'

Installing spree_reviews caused default spree product routes to stop working

I am a newbie so any help will be greatly appreciated.

I am using Rails 4.0.5 and ruby 2.1.0p0

Here is my Gemfile -
source 'https://rubygems.org'
gem 'rails', '4.0.5'
gem 'sqlite3'
gem 'sass-rails', '> 4.0.2'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '
> 4.0.0'
gem 'jquery-rails'
https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'spree_variant_options'
gem 'spree_reviews', github: 'spree/spree_reviews', branch: '2-2-stable'
group :doc do
gem 'sdoc', require: false
end

add drop ship

gem 'spree_drop_ship', github: 'jdutil/spree_drop_ship', branch: '2-2-breakage'
gem 'spree_marketplace', github: 'jdutil/spree_marketplace', branch: 'stripe_2_2'
gem 'spree', '2.2.2'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-2-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-2-stable'

After installing spree_reviews (initially I installed few other review plugins but they were not compatible), I am having problem in admin -> products and shipments section with various routes -

Showing /home/ubuntu/.rvm/gems/ruby-2.1.0/gems/spree_backend-2.2.2/app/views/spree/admin/products/index.html.erb where line #82 raised:

No route matches {:action=>"edit", :controller=>"spree/admin/products", :format=>nil, :id=>#<Spree::Product id: 23, name: "Apache Baseball Jersey",

Showing /home/ubuntu/.rvm/gems/ruby-2.1.0/bundler/gems/spree_drop_ship-27aed68a88b5/app/views/spree/admin/shipments/index.html.erb where line #85 raised:

No route matches {:action=>"edit", :controller=>"spree/admin/shipments", :format=>nil, :id=>#<Spree::Shipment id: 4, tracking: nil,

Any help will be greatly appreciated.

Thx
Rajat

API v2 Support

Is there V2 API support for this gem?
If not, is this something that you would consider an acceptable PR? I can work on it.
Please let me know your thoughts for the requirements and implementation of the same.

NoMethodError in Spree::Admin::Reviews#index

Getting error while clicking the 'reviews' in the spree admin panel.

error

index.html.erb

   `  <% content_for :page_title do %>
      <%= Spree.t('reviews') %>
      <% end %>

      <% render 'spree/admin/shared/product_sub_menu' %>

      <% content_for :table_filter_title do %>
      <%= Spree.t('search') %>
      <% end %>

      <% content_for :table_filter do %>
      <div data-hook="admin_reviews_index_search">

      <%= search_form_for [:admin, @search] do |f| %>
      <div class="alpha three columns">
      <div class="field">
      <%= label_tag nil, Spree.t(:user) %><br />
      <%= f.text_field :name_cont, :size => 25 %>
      </div>
      </div>

      <div class="seven columns">
      <div class="field">
      <%= label_tag nil, Spree.t(:title) -%><br/>
      <%= f.text_field :title_cont, :size => 25  -%>
      </div>
      </div>

      <div class="four columns">
      <div class="field">
      <%= label_tag nil, Spree.t(:review) -%><br/>
      <%= f.text_field :review_cont, :size => 25  -%>
      </div>
      </div>

      <div class="two columns omega">
      <div class="field">
      <%= label_tag nil, Spree.t(:approval_status)-%><br/>
      <%= f.select :approved_eq, [[Spree.t('all'), nil], [Spree.t('approved_reviews'), true], [Spree.t('unapproved_reviews'), false]]  -%>
      </div>
      </div>

      <div class="clear"></div>

      <div class="form-buttons actions filter-actions" data-hook="admin_reviews_index_search_buttons">
      <%= button Spree.t(:search), 'icon-search' %>
      </div>
      <%- end -%>
      </div>
      <%- end -%>
      <pre>
      <%= Spree::Review.inspect %>
      <%= params[:q][:title_cont].inspect %>

      <% if params[:q][:title_cont].present? == true %>
      <%= @reviews.inspect %>
      <%end%>  
      </pre>
      <% if @reviews.nil? %>
      <table class="index">
      <colgroup>
      <col style="width: 25%;">
      <col style="width: 10%;">
      <col style="width: 10%;">
      <col style="width: 20%;">
      <col style="width: 15%;">
      <col style="width: 17%;">
      </colgroup>
      <thead>
      <tr>
      <th><%= Spree.t('product') %></th>
      <th><%= Spree::Review.human_attribute_name(:rating) %></th>
      <th><%= Spree.t('feedback') %></th>
      <th><%= Spree::Review.human_attribute_name(:user) %></th>
      <th><%= Spree::Review.human_attribute_name(:created_at) %></th>
      </tr>
      </thead>
      <tbody>
      <%- @reviews.each do |review| -%>
      <tr id="<%= dom_id review %>">
      <td>
      <% if review.product %>
      <%= link_to review.product.name, product_path(review.product) %>
      <% end %>
      </td>
      <td class="align-center">
      <%= txt_stars(review.rating) %>
      </td>
      <td class="align-center">
      <%= link_to "(#{review.feedback_stars}/#{review.feedback_reviews.size})", admin_review_feedback_reviews_path(review) %>
      </td>
      <td class="align-center">
      <%= review.user_id ? link_to(review.user.try(:email), [:admin, review.user]) : Spree.t(:anonymous) %></p>
      <p><%= Spree::Review.human_attribute_name(:ip_address) %>: <%= review.ip_address ? link_to(review.ip_address, "http://whois.domaintools.com/#{review.ip_address}") : '-' %></p>
      </td>
      <td class="align-center">
      <%= l review.created_at, :format => :short %>
      </td>
      <td class="actions">
      <%= link_to_with_icon 'check', Spree.t('approve'), approve_admin_review_url(review), :no_text => true, class: 'approve' unless review.approved %>
      &nbsp;
      <%= link_to_edit review, :no_text => true, :class => 'edit' %>
      &nbsp;
      <%= link_to_delete review, :no_text => true %>
      </td>
      </tr>
      <% end %>
      </tbody>
      </table>
      <% else %>
      <div class="no-objects-found">
      <%= Spree.t(:no_results) %>
      </div>
      <% end %>

`
Model - review.rb

   `class Spree::Review < ActiveRecord::Base

      belongs_to :product, touch: true
      belongs_to :user, :class_name => Spree.user_class.to_s
      has_many   :feedback_reviews

      after_save :recalculate_product_rating, :if => :approved?
      after_destroy :recalculate_product_rating

      validates :name, presence: true
      validates :review, presence: true

      validates :rating, numericality: { only_integer: true,
      greater_than_or_equal_to: 1, 
      less_than_or_equal_to: 5,
      message: Spree.t('you_must_enter_value_for_rating') }


      default_scope { order("spree_reviews.created_at DESC") }

      scope :localized, ->(lc) { where('spree_reviews.locale = ?', lc) }
      scope :most_recent_first, -> { order('spree_reviews.created_at DESC') }
      scope :oldest_first, -> { reorder('spree_reviews.created_at ASC') }
      scope :preview, -> { limit(Spree::Reviews::Config[:preview_size]).oldest_first }
      scope :approved, -> { where(approved: true) }
      scope :not_approved, -> { where(approved: false) }
      scope :default_approval_filter, -> { Spree::Reviews::Config[:include_unapproved_reviews] ? all : approved }

      def feedback_stars
      return 0 if feedback_reviews.size <= 0
      ((feedback_reviews.sum(:rating) / feedback_reviews.size) + 0.5).floor
      end

      def set_search
      @search=Product.search(params[:q])
      end

      def recalculate_product_rating
      self.product.recalculate_rating if product.present?
      end
      end

`

reviews_controller.rb:

     ` class Spree::Admin::ReviewsController < Spree::Admin::ResourceController
      helper Spree::ReviewsHelper
      def index
      @reviews = collection
      end

      def approve
      r = Spree::Review.find(params[:id])

      if r.update_attribute(:approved, true)
      flash[:notice] = Spree.t("info_approve_review")
      else
      flash[:error] = Spree.t("error_approve_review")
      end
      redirect_to admin_reviews_path
      end

      def edit
      if @review.product.nil?
      flash[:error] = Spree.t("error_no_product")
      redirect_to admin_reviews_path and return
      end
      end

      private

      def collection
      params[:q] ||= {}
      @search = Spree::Review.ransack(params[:q])
      @collection = @search.result.includes([:product, :user, :feedback_reviews]).page(params[:page]).per(params[:per_page])
      end
      end`

Gemfile:

`source 'https://rubygems.org'
 gem 'rails', '>= 4.0.8'

 # Use sqlite3 as the database for Active Record
 gem 'mysql2', '~> 0.3.18'

 # Use SCSS for stylesheets
 gem 'sass-rails', '~> 4.0.2'
 gem 'compass-rails'

 # Provides the generator settings required for Rails to use Haml
 gem 'haml-rails'

 # Use Uglifier as compressor for JavaScript assets
 gem 'uglifier', '>= 1.3.0'

 # Use CoffeeScript for .js.coffee assets and views
 gem 'coffee-rails', '~> 4.0.0'
 gem 'jquery-rails'
 gem 'bootstrap-sass', '~> 3.1.1'
 gem 'jbuilder', '~> 1.2'
 group :doc do
 gem 'sdoc', require: false
 end
gem 'braintree'
gem 'spree', github: 'spree/spree', branch: '2-2-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-2-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '2-2-stable'
gem 'spree_editor', github: 'spree-contrib/spree_editor', branch: '2-2-stable'
gem 'spree_blogging_spree', github: 'stefansenk/spree-blogging-spree', branch: '2-2-stable'
gem 'spree_paypal_express', github: 'spree-contrib/better_spree_paypal_express', branch: '2-2-stable'
gem 'spree_reviews', github: 'spree-contrib/spree_reviews', branch: '2-2-stable'
gem 'spree_variant_options', git: 'git://github.com/AgilTec/spree_variant_options.git', branch: '2-2-stable'
gem 'social-share-button'
gem 'instagram',  :git => 'git://github.com/Instagram/instagram-ruby-gem.git'
gem 'will_paginate','~> 3.1.5'




gem 'capistrano', '~> 3.2.0'
gem 'capistrano-rails', '~> 1.1'
gem 'capistrano-rvm'
gem 'capistrano-bundler', '~> 1.1.2'

gem 'therubyracer'

gem 'mail_view', '~> 2.0.4'

group :production do
  gem 'passenger'
end

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

`

not seeing the star image

Hi, after upgrading to 1-3-stable I only see the input type radio without the star.gif
Screen Shot 2013-01-19 no star
applied to it.

Jquery Rating Plugin Not 1.9 compatible

Getting error:

Cannot read property 'msie' of undefined

in Spree 1.3.2 due to the fact jquery rating is not 1.9 compatible. We either need to require the migrate on the front end (which I'm doing temporarily) or fix the rating code ourselves.

Thoughts?

Production mode pulls error when create new review

Hello,

I love this extension. Everything works as expected in Development mode; but when I deploy to Heroku, it pulls the error:

2012-08-16T07:22:40+00:00 app[web.1]: Started GET "/products/spree-ringer-t-shirt/reviews/new" for [MY IP HERE] at 2012-08-16 07:22:40 +0000
2012-08-16T07:22:41+00:00 app[web.1]: 
2012-08-16T07:22:41+00:00 app[web.1]: ActionView::Template::Error (undefined method `title' for #<Spree::Review:0x00000004dc8c88>):
2012-08-16T07:22:41+00:00 app[web.1]:     13: 
2012-08-16T07:22:41+00:00 app[web.1]:     14:   <p class="review_title_field">
2012-08-16T07:22:41+00:00 app[web.1]:     15:     <%= f.label :title %><br />
2012-08-16T07:22:41+00:00 app[web.1]:     16:     <%= f.text_field :title, :maxlength => "255", :size => "50" %>
2012-08-16T07:22:41+00:00 app[web.1]:     17:   </p>
2012-08-16T07:22:41+00:00 app[web.1]:     18:   
2012-08-16T07:22:41+00:00 app[web.1]:     19:   <p class="review_review_field">

I also run migration on Heroku as I did in Development mode. What did I miss here?

Thank you!!!

Visitors and (some) users see nothing after "Write your own review"

Really like this extension. I'm wondering how I can add an explanatory sentence after visitors who aren't authorized to create reviews for a product click on the link... Currently it looks like a mostly blank page for unlogged visitors and even for some users.

I assume that the authorization logic checks to see whether the user is an admin or has previously purchased the product to allow them to post a review, but I don't know this for sure.

Thanks!

Feature: Allow user to create only 1 review of a product

While working on this extension I realized a user can post an unlimited amount of reviews for a certain product. Should a user be allowed to do this ?

In my opinion a single review should suffice. A consequence of this is probably that we should also allow users to change their reviews (and have them re-approved). What do you think ?

I'm willing to do a pull-request which implements this feature but am first trying to gather some feedback wether or not other people think this is desired behavior.

API support

Can not find any APIs to integrate so that I can get and post reviews for a product.

Dev notes for master branch.

After some refactor on master branch I noticed a lot that can be improved:

  • Rating JS need to be swapped out with something newer, we way past using images as icons.
  • Fix button icons and some layout tweaks when helpers etc has been improved in Spree.
  • Settings support for multiple stores.
  • Allow user to create only 1 review of a product #18

These are dev memory notes, you welcome to help out with PR if you find it valid.

Incompatible with Spree 4.1

Extension depends on spree_auth_devise (>= 3.1.0, < 4.0) and newest version is spree_auth_devise (= 4.1.0)
Any plans to issue an update?

Update readme file

, :git => 'git://github.com/romul/spree_reviews.git'
should be
, :git => 'git://github.com/spree/spree_reviews.git'

and more I'd guess.

Radio buttons instead of stars?

Hi Guys,

I've just tried the 2.2 branch and instead of stars, like in 2.1, only radio buttons appear. Is this a bug, or this is by design? (I liked stars better).

If this is by design, then I think stars should still be an option in the Review settings menu. Like "Display stars instead of radio buttons".

Best Wishes,
Matt

Unlogged Users can post reviews

I'm working on 1-1-stable branch and "Connected users" restriction seems to not working fine :(
I'll submit a pull request if I find a way to fix this.

3-0-stable version

Are you guys planning on 3-0-stable version which points to spree 3-0 branch.

Current spree_reviews master points to 3.1.0.beta and there's no 3-0-stable branch. We're planning on upgrading to spree 3-0-stable branch and we're stuck here.

Branch for 2-1-stable

I have a branch working with spree 2-1-stable, I would like to contribute, could you please create a branch '2-1-stable' ?

show_unapproved_ratings setting not behaving properly

2 things are happening when show_unapproved_ratings is checked:

  • Unapproved reviews do not count toward the compiled rating at the top. This is funky when there is one unapproved review showing and the top rating is blank and says "Based on 0 Reviews"
  • When there are no reviews, Instead of displaying the "There are no reviews" line it displays a blank rating that says (Based On 0 Reviews)

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler could not find compatible versions for gem "spree_auth_devise":
  In Gemfile:
    spree_auth_devise

    spree_reviews was resolved to 0.0.1, which depends on
      spree_auth_devise (>= 3.1.0, < 4.0)

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Partials missing

Hey, guys.

I'm using the gem and the 3.3.0 version is installed. However, when I performed the spree_reviews:install none of the partials mentioned here were created. What is the correct approach to override this partials and modify their look and feel.

Do I need to manually created them?

Apologies if this is not the correct way of asking.

Thanks!

In 1-3-stable, it's spree_user_signed_in? not user_signed_in?

diff --git a/app/controllers/spree/reviews_controller.rb b/app/controllers/spree/reviews_controller.rb
index 2e4b74a..4862398 100644
--- a/app/controllers/spree/reviews_controller.rb
+++ b/app/controllers/spree/reviews_controller.rb
@@ -18,7 +18,7 @@ class Spree::ReviewsController < Spree::StoreController

     @review = Spree::Review.new(params[:review])
     @review.product = @product
-    @review.user = spree_current_user if user_signed_in?
+    @review.user = spree_current_user if spree_user_signed_in?
     @review.ip_address = request.remote_ip
     @review.locale = I18n.locale.to_s if Spree::Reviews::Config[:track_locale]

installation error

I followed the installation instruction, editing the gem file, bundle up ... but I got errors when running "rails g spree_reviews:install" Here's the error msg:

spree_reviews_hook.rb:1:in <top (required)>': uninitialized constant Spree::Theme Support (NameError) from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/polyglot-0.3.3 /lib/polyglot.rb:63:inrequire'
from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/polyglot-0.3.3
/lib/polyglot.rb:63:in require' from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spree_reviews- 0.50.1/lib/spree_reviews.rb:2:in<top (required)>'
from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.2.0/
lib/bundler/runtime.rb:68:in require' from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.2.0/ lib/bundler/runtime.rb:68:inblock (2 levels) in require'
from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.2.0/
lib/bundler/runtime.rb:66:in each' from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.2.0/ lib/bundler/runtime.rb:66:inblock in require'
from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.2.0/
lib/bundler/runtime.rb:55:in each' from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.2.0/ lib/bundler/runtime.rb:55:inrequire'
from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.2.0/
lib/bundler.rb:128:in require' from .../Sites/my_app/config/application.rb:7:in<top (required)>'
from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.8
/lib/rails/commands.rb:24:in require' from ...Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.8 /lib/rails/commands.rb:24:in<top (required)>'
from script/rails:6:in require' from script/rails:6:in

'

Did I miss something?

Should this repo have a 2-0-stable branch?

The master branch seems to work just fine for Spree 2.0 but I was wondering for consistency across all your official repos if this project should also have a 2-0-stable branch?

Redo the Backend UI using Ransack/MetaSearch

Currently both scopes are shown: approved and unapproved.

  1. Need to provide a metasearch\ransack sidebar and allow a faux-state-machine dropdown for these scopes
  2. Need to only show unapproved reviews by default

Reminder to self.

recalculate_product_rating method not working

The Spree::Review model has a method called recalculate_product_rating that updates the avg_rating and reviews_count of the related product.

The avg_rating and reviews_count attributes are not listed as attr_accessible in the product decorator, however, so this attribute update fails every time.

To reproduce, add this gem to an existing spree site, add reviews to a product and approve them. You'll notice that the avg_rating and reviews_count will remain at 0 for that product.

The following snippet, added to app/models/spree/product_decorator.rb will fix the problem:

attr_accessible :avg_rating, :reviews_count

Thanks!

Avg rating does not show in decimal.

When i am trying to show the avg rating in decimal like .5,1.5,2.5 then the stars formation does not happening.I change the method of product decorator like this-:
def stars
avg_rating.to_f || 0
end
But then stars does not appear i want that actual avg rating like 1.5,2.5,3.5 will also be shown in the avg rating.
Please help.

Cannot Install spree_reviews using Spree 4.0

Hello. I am trying to install spree_reviews from a fresh install of Spree Commerce 4.0. I have attached my gem file. As per the instructions on your site, I placed, gem 'spree_reviews', github: 'spree-contrib/spree_reviews', in the gem file and ran the bundle command. When I did, I received the following error:

Bundler could not find compatible versions for gem "spree_auth_devise":
In snapshot (Gemfile.lock): spree_auth_devise (= 4.0.0)

In Gemfile: spree_auth_devise (~> 4.0)

spree_reviews was resolved to 3.3.0, which depends on
  spree_auth_devise (>= 3.1.0, < 4.0)

Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

After which, I ran bundle update and then received the following error:

Bundler could not find compatible versions for gem "spree_auth_devise":
In Gemfile: spree_auth_devise (~> 4.0)

spree_reviews was resolved to 3.3.0, which depends on
  spree_auth_devise (>= 3.1.0, < 4.0)

Thank you in advanced for your assistance with this issue.
gemfile.txt

Invalid route name

"Invalid route name, already in use: 'feedback_reviews' You may have defined two routes with the same name using the :as option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with resources as explained here: http://guides.rubyonrails.org/routing.html#restricting-the-routes-created"

gem 'rails', '4.0.2'
em 'spree', github: 'spree/spree', branch: '2-2-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-2-stable'
gem 'spree_reviews', github: 'spree/spree_reviews', branch: '2-2-stable'

This works:

tomkrus@ee89e83

Product show page render text instead of html

Hello! I'm try to use your gem in branch "3-0-stable" and have next problem:
After bundle install and migrations on product page i see html text instead of html. All elements inside forms and link_to helper become text.

untitled-2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.