Updated

app/controllers/admin / petition_statistics_controller.rb

A
15 lines of codes
2 methods
4.1 complexity/method
1 churn
8.1 complexity
0 duplications
class Admin::PetitionStatisticsController < Admin::AdminController
  1. Admin::PetitionStatisticsController assumes too much for instance variable '@petition'
  2. Admin::PetitionStatisticsController has no descriptive comment
before_action :require_sysadmin before_action :fetch_petition def update UpdatePetitionStatisticsJob.perform_later(@petition) redirect_to admin_petition_url(@petition), notice: :enqueued_petition_statistics_update end private def fetch_petition @petition = Petition.moderated.find(params[:petition_id]) end end