Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sorbet for type checking #1873

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Start adding type checking to boards_controller
Throne3d committed Aug 6, 2024
commit 092ce21455f703acbc76800424359f5a254d44a0
7 changes: 5 additions & 2 deletions app/controllers/boards_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true
# typed: true
class BoardsController < ApplicationController
before_action :login_required, except: [:index, :show, :search]
before_action :find_model, only: [:show, :edit, :update, :destroy]
@@ -10,7 +11,8 @@ def index
if params[:user_id].present?
unless (@user = User.active.full.find_by(id: params[:user_id]))
flash[:error] = "User could not be found."
redirect_to root_path and return
redirect_to root_path
return
end

@page_title = if @user.id == current_user.try(:id)
@@ -106,7 +108,8 @@ def destroy
def mark
unless (board = Board.find_by(id: params[:board_id]))
flash[:error] = "Continuity could not be found."
redirect_to unread_posts_path and return
redirect_to unread_posts_path
return
end

if params[:commit] == "Mark Read"