Updated

app/controllers/admin / petition_details_controller.rb

A
27 lines of codes
4 methods
3.0 complexity/method
16 churn
11.85 complexity
0 duplications
class Admin::PetitionDetailsController < Admin::AdminController
  1. Admin::PetitionDetailsController assumes too much for instance variable '@petition'
  2. Admin::PetitionDetailsController has no descriptive comment
before_action :fetch_petition def show end def update if @petition.update_attributes(petition_params) redirect_to [:admin, @petition], notice: :petition_updated else render :show end end private def fetch_petition @petition = Petition.find(params[:petition_id]) end def petition_params params.require(:petition).permit( :action, :background, :additional_details, :special_consideration, :creator_attributes => [:name] ) end end