Class: Spree::Admin::ReviewsController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Spree::Admin::ReviewsController
- Defined in:
- app/controllers/spree/admin/reviews_controller.rb
Instance Method Summary collapse
- #index ⇒ Object
-
#model_class ⇒ Object
We map this controller to the Spree::ProductReview model.
Instance Method Details
#index ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/controllers/spree/admin/reviews_controller.rb', line 9 def index # Eager load product and user to prevent N+1 queries @product_reviews = Spree::ProductReview.accessible_by(current_ability) .includes(:product, :user, images_attachments: :blob) .order(created_at: :desc) .page(params[:page]) end |
#model_class ⇒ Object
We map this controller to the Spree::ProductReview model
5 6 7 |
# File 'app/controllers/spree/admin/reviews_controller.rb', line 5 def model_class Spree::ProductReview end |