Sha256: a2a5127b3ecf98474d844a80a6a7eddfcbdbb2712d852b0e6970b022a423c997
Contents?: true
Size: 1.7 KB
Versions: 8
Compression:
Stored size: 1.7 KB
Contents
module Sis module Core class Application < ApplicationRecord include AASM # Gender types MALE = 'Male'.freeze FEMALE = 'Female'.freeze aasm column: :status do state :draft, initial: true state :submitted, :under_review, :rejected, :selected_for_exam, :selected_for_admission, :waiting, :accepted, :declined event :submit do transitions from: :draft, to: :submitted end event :review do transitions from: %i[submitted rejected], to: :under_review end event :reject do transitions from: :under_review, to: :rejected end event :select_for_exam do transitions from: %i[submitted under_review], to: :selected_for_exam end event :select_for_admission do transitions from: :selected_for_exam, to: :selected_for_admission end event :select_for_waiting do transitions from: :selected_for_exam, to: :waiting end event :accept do transitions from: :selected_for_admission, to: :accepted end event :decline do transitions from: :selected_for_admission, to: :declined end end validates :status, presence: true validates :payment_information, presence: true, if: :payment_made belongs_to :applicant belongs_to :application_setup has_many :application_documents delegate(:name, to: :application_setup, prefix: true, allow_nil: false) delegate(:full_name, to: :applicant, prefix: true, allow_nil: false) delegate(:academic_programme_id, to: :application_setup, prefix: false, allow_nil: false) end end end
Version data entries
8 entries across 8 versions & 1 rubygems