app/controllers/school_misses_controller.rb
SchoolMissesController assumes too much for instance variable '@school_miss'
SchoolMissesController has no descriptive comment
Missing top-level class documentation comment.class SchoolMissesController < ApplicationController include SessionsHelper # def index # id = params[:id] # if ( is_employee? or verify_alumn(id) or is_son?(id) ) # @misses = @alumn.school_misses.all # end # end # def show # #if ( logged_in? ) # # @school_miss = SchoolMiss.find(params[:id]) # #end # end def newSchoolMissesController tests '( is_employee? )' at least 4 times
Space inside parentheses detected.
Don't use parentheses around a method call.
Don't use parentheses around the condition of an `if`. if ( is_employee? ) @school_miss = SchoolMiss.new elsePrefer single-quoted strings when you don't need string interpolation or special symbols. redirect_to "/errors/error_500" end end # will not be necessary when "beep" is implementedMethod has too many lines. [11/10] def createSpace inside parentheses detected.
Don't use parentheses around a method call.
Don't use parentheses around the condition of an `if`. if ( is_employee? ) @school_miss = SchoolMiss.new(school_miss_params) @school_miss.alumn_id = Alumn.current.idSpace inside parentheses detected.
Don't use parentheses around the condition of an `if`.
Don't use parentheses around a method call. if ( @school_miss.save ) redirect_to alumn_path(@school_miss.alumn_id) else render new_school_miss_path end elsePrefer single-quoted strings when you don't need string interpolation or special symbols. redirect_to "/errors/error_500" end end def editSpace inside parentheses detected.
Don't use parentheses around the condition of an `if`.
Don't use parentheses around a method call. if ( is_employee? )Use 2 (not 1) spaces for indentation. @school_miss = SchoolMiss.find(params[:id]) # @alumn = Alumn.find_by_id(@school_miss.alumn_id) elsePrefer single-quoted strings when you don't need string interpolation or special symbols. redirect_to "/errors/error_500" end end def updateSpace inside parentheses detected.
Don't use parentheses around the condition of an `if`.
Don't use parentheses around a method call. if ( is_employee? ) # alumns/idalumn/school_misses/idmiss # @school_miss.alumn_id = Alumn.current.idMissing space after `#`. #alumn = Alumn.find(params[:id])Missing space after `#`. #@school_miss = alumn.school_misses.find(params[:id]) @school_miss = SchoolMiss.find(params[:id])Space inside parentheses detected.
Don't use parentheses around the condition of an `if`.
Don't use parentheses around a method call. if ( @school_miss.update(school_miss_params) ) redirect_to alumn_path(@school_miss.alumn_id)Redundant `else`-clause. else # render edit_school_miss_path end elsePrefer single-quoted strings when you don't need string interpolation or special symbols. redirect_to "/errors/error_500" end end def destroySpace inside parentheses detected.
Don't use parentheses around a method call.
Don't use parentheses around the condition of an `if`. if ( is_principal? ) @school_miss = SchoolMiss.find(params[:id]) @school_miss.destroy redirect_to alumn_path(@school_miss.alumn_id) elsePrefer single-quoted strings when you don't need string interpolation or special symbols. redirect_to "/errors/error_500" end end Keep a blank line before and after `private`. private def school_miss_paramsSpace missing after comma. params.require(:school_miss).permit(:date,:alumn_id) endend