class AcademicProgram
AcademicProgram:
Constants
- ATTACHMENT_METADATA_FIELDS
- ATTACHMENT_TYPES
only use these attachment types in the attachment metadata field
- CATEGORIES
- COMPLETION_AWARDS
- DEGREES
- LEVELS
Public Instance Methods
as_indexed_json(*)
click to toggle source
# File lib/buweb/academic_program.rb, line 198 def as_indexed_json(*) { title: title, slug: slug, level: level, degree: degree, discipline: discipline } end
assessment_plans()
click to toggle source
method for finding attachments with 'assessment-plan' metadata type
# File lib/buweb/academic_program.rb, line 177 def assessment_plans attachments.where('metadata.type' => 'assessment-plan').to_a end
assessment_schedules()
click to toggle source
method for finding attachments with 'assessment-schedule' metadata type
# File lib/buweb/academic_program.rb, line 182 def assessment_schedules attachments.where('metadata.type' => 'assessment-schedule').to_a end
curriculum_maps()
click to toggle source
method for finding attachments with 'curriculum-map' metadata type
# File lib/buweb/academic_program.rb, line 172 def curriculum_maps attachments.where('metadata.type' => 'curriculum-map').to_a end
dont_index?()
click to toggle source
# File lib/buweb/academic_program.rb, line 217 def dont_index? !published_to_production end
force_nil_degree()
click to toggle source
ensure nil and not empty string
# File lib/buweb/academic_program.rb, line 162 def force_nil_degree self.degree = degree.presence end
plo_reports()
click to toggle source
method for finding attachments with 'plo-assessment-report' metadata type
# File lib/buweb/academic_program.rb, line 167 def plo_reports attachments.where('metadata.type' => 'plo-assessment-report').to_a end
pr_executive_summaries()
click to toggle source
method for finding attachments with 'executive-summary-review' metadata type
# File lib/buweb/academic_program.rb, line 187 def pr_executive_summaries attachments.where('metadata.type' => 'executive-summary-review').to_a end
Private Instance Methods
set_level()
click to toggle source
# File lib/buweb/academic_program.rb, line 223 def set_level return unless degree? COMPLETION_AWARDS.each do |grouping| # last match wins self.level = grouping[:level] if grouping[:degrees].include?(degree) end end