infusionvlc/ConexionFelina

View on GitHub
app/models/task.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Task < ApplicationRecord
  MAXIMUM_NAME_LENGTH = 50
  MAXIMUM_BIO_LENGTH = 1024

  has_many :assignments
  has_many :colonies, through: :assignments

  validates :name, presence: true
  validates :name, length: {maximum: MAXIMUM_NAME_LENGTH}
  validates :description, length: {maximum: MAXIMUM_BIO_LENGTH}
end