Sha256: a3519a3442f8fffd68812f7126ccce5b79caa61e144e69863ff2114d89d0f972
Contents?: true
Size: 411 Bytes
Versions: 16
Compression:
Stored size: 411 Bytes
Contents
module Gaku class EnrollmentStatus < ActiveRecord::Base has_many :students, foreign_key: :enrollment_status_code, primary_key: :code translates :name validates :code, presence: true, uniqueness: true before_create :set_name scope :active, -> { where(active: true) } def to_s name end private def set_name self.name = code if name.nil? end end end
Version data entries
16 entries across 16 versions & 2 rubygems