Updated

app/controllers/admin/archived / locks_controller.rb

A
45 lines of codes
6 methods
3.6 complexity/method
4 churn
21.4 complexity
0 duplications
class Admin::Archived::LocksController < Admin::AdminController
  1. Admin::Archived::LocksController assumes too much for instance variable '@petition'
  2. Admin::Archived::LocksController has no descriptive comment
before_action :fetch_petition def show @petition.update_lock!(current_user) respond_to do |format| format.json end end def create @petition.checkout!(current_user) respond_to do |format| format.json end end def update @petition.force_checkout!(current_user) respond_to do |format| format.json end end def destroy @petition.release!(current_user) respond_to do |format| format.json end end private def last_request_update_allowed? false end def fetch_petition @petition = ::Archived::Petition.find(params[:petition_id]) end end