app/models/course.rb in mumuki-domain-8.6.1 vs app/models/course.rb in mumuki-domain-9.0.0

- old
+ new

@@ -1,11 +1,11 @@ class Course < ApplicationRecord include Mumuki::Domain::Syncable include Mumuki::Domain::Helpers::Course include Mumuki::Domain::Area - validates_presence_of :slug, :shifts, :code, :days, :period, :description, :organization_id + validates_presence_of :slug, :period, :code, :description, :organization_id validates_uniqueness_of :slug belongs_to :organization has_many :invitations @@ -31,9 +31,13 @@ if closed? generate_invitation! expiration_date else current_invitation end + end + + def canonical_code + "#{period}-#{code}".downcase end def closed? current_invitation.blank? || current_invitation.expired? end