diff --git a/app/controllers/admin/control_point_controller.rb b/app/controllers/admin/control_point_controller.rb index 2ea2021..5d43457 100644 --- a/app/controllers/admin/control_point_controller.rb +++ b/app/controllers/admin/control_point_controller.rb @@ -29,8 +29,6 @@ def update def destroy assigned_models_count = - Room.where(control_point_id: params[:id]).count + - Device.where(control_point_id: params[:id]).count + Channel.where(control_point_id: params[:id]).count if assigned_models_count.zero?