extinctionrebellion/RebelsManager

View on GitHub
app/models/skill.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# == Schema Information
#
# Table name: skills
#
#  id          :bigint           not null, primary key
#  code        :string
#  description :text
#  name        :string
#  created_at  :datetime         not null
#  updated_at  :datetime         not null
#

class Skill < ApplicationRecord
  has_many :rebel_skills
  has_many :rebels, through: :rebel_skills

  validates :code, presence: true, uniqueness: {
    message: "This code has already been used, please use another."
  }
end