1class Admin::PetitionStatisticsController < Admin::AdminController |
|
2 before_action :require_sysadmin |
|
3 before_action :fetch_petition |
|
5 def update |
|
6 UpdatePetitionStatisticsJob.perform_later(@petition) |
|
7 redirect_to admin_petition_url(@petition), notice: :enqueued_petition_statistics_update |
|
8 end |
|
10 private
|
|
12 def fetch_petition |
|
13 @petition = Petition.moderated.find(params[:petition_id]) |
|
14 end |
|
15end |