Updated

app/controllers/admin/archived / petition_details_controller.rb

A
28 lines of codes
5 methods
2.9 complexity/method
1 churn
14.32 complexity
0 duplications
class Admin::Archived::PetitionDetailsController < Admin::AdminController
  1. Admin::Archived::PetitionDetailsController assumes too much for instance variable '@petition'
  2. Admin::Archived::PetitionDetailsController has no descriptive comment
before_action :fetch_petition def show end def update if @petition.update_attributes(petition_params) redirect_to admin_archived_petition_url(@petition), notice: :petition_updated else render :show end end private def fetch_petition @petition = ::Archived::Petition.find(params[:petition_id]) end def petition_attributes %i[action background additional_details special_consideration] end def petition_params params.require(:archived_petition).permit(*petition_attributes) end end