Sha256: d585ed69f726b67ba2d43c49a2330418679efb3bd74c8c308f9538e8dbdf4219

Contents?: true

Size: 557 Bytes

Versions: 5

Compression:

Stored size: 557 Bytes

Contents

class Admin::ReviewsController < Admin::ResourceController
  helper ReviewsHelper

  def index
    @unapproved_reviews = Review.not_approved.find(:all, :order => "created_at DESC")
    @approved_reviews   = Review.approved.find(:all, :order => "created_at DESC")
  end

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_reviews_rating-0.70.7.1 app/controllers/admin/reviews_controller.rb
spree_reviews_rating-0.70.7 app/controllers/admin/reviews_controller.rb
spree_reviews_rating-0.70.6.1 app/controllers/admin/reviews_controller.rb
spree_reviews_rating-0.70.6 app/controllers/admin/reviews_controller.rb
spree_reviews_rating-0.70.5 app/controllers/admin/reviews_controller.rb