fga-gpp-mds/2017.1-Escola-X

View on GitHub
app/models/subject.rb

Summary

Maintainability
A
0 mins
Test Coverage
Subject has no descriptive comment
Missing top-level class documentation comment.
class Subject < ApplicationRecord
Tab detected.
Use 2 (not 1) spaces for indentation.
belongs_to :teacher
Tab detected.
has_many :grades, dependent: :destroy
Tab detected.
has_many :classroom_subjects, dependent: :destroy
Tab detected.
has_many :alumns, through: :grades
Tab detected.
has_many :classrooms, through: :classroom_subjects
Tab detected.
belongs_to :classroom_grade
Tab detected.
validates_associated :grades
Tab detected.
validates_associated :alumns
 
Inconsistent indentation detected.
validates :name_subject,
Align the parameters of a method call if they span more than one line.
Tab detected.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
presence: { message: "Não pode estar em branco!" },
Tab detected.
length: { minimum: 5,
Align the elements of a hash literal if they span more than one line.
Tab detected.
maximum: 20,
Align the elements of a hash literal if they span more than one line.
Tab detected.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
Use the new Ruby 1.9 hash syntax.
:too_short => "deve possuir mais de 5 caracteres.",
Tab detected.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
Use the new Ruby 1.9 hash syntax.
Align the elements of a hash literal if they span more than one line.
Space inside } missing.
:too_long => "deve possuir no máximo 20 caracteres."}
 
Extra blank line detected.
 
Inconsistent indentation detected.
validates :teacher,
Prefer single-quoted strings when you don't need string interpolation or special symbols.
presence: { message: "não válido para criar matéria!" },
uniqueness: true
Extra empty line detected at class body end.
 
end