Updated

app/controllers/admin / holidays_controller.rb

A
34 lines of codes
5 methods
3.5 complexity/method
1 churn
17.38 complexity
19 duplications
class Admin::HolidaysController < Admin::AdminController
  1. Admin::HolidaysController assumes too much for instance variable '@holiday'
  2. Admin::HolidaysController has no descriptive comment
before_action :require_sysadmin before_action :fetch_holiday def edit respond_to do |format| format.html end end def update
  1. Similar code found in 2 nodes Locations: 0 1
if @holiday.update(holiday_params) redirect_to edit_admin_site_url, notice: :site_updated else respond_to do |format| format.html { render :edit } end end end private def fetch_holiday @holiday = Holiday.instance end def holiday_params params.require(:holiday).permit(*holiday_attributes) end def holiday_attributes %i[christmas_start christmas_end easter_start easter_end] end end