Sha256: 8be35e434dd68430c6ea563bbd3c2be242f2be09e4b50923d58c3133311eb164
Contents?: true
Size: 254 Bytes
Versions: 6
Compression:
Stored size: 254 Bytes
Contents
# frozen_string_literal: true class LessonError < Exception end class Lesson < ActiveRecord::Base has_and_belongs_to_many :students before_destroy :ensure_no_students def ensure_no_students raise LessonError unless students.empty? end end
Version data entries
6 entries across 6 versions & 2 rubygems