You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
949 B
35 lines
949 B
# encoding: utf-8
|
|
# major_level 1 研究生 2 本科生 3 专科生
|
|
class Major < ActiveRecord::Base
|
|
belongs_to :first_level_discipline
|
|
belongs_to :discipline_category
|
|
has_many :major_courses
|
|
has_many :shixun_major_courses
|
|
has_many :subjects
|
|
attr_accessible :major_code, :major_level, :name, :first_level_discipline_id, :discipline_category_id,:support_shixuns,:created_at,:updated_at
|
|
# 课程的学科门类
|
|
def major_discipline_category
|
|
self.discipline_category ? self.discipline_category.name : ''
|
|
end
|
|
|
|
# 课程的一级学科
|
|
def major_first_level_discipline
|
|
self.first_level_discipline ? self.first_level_discipline.name : ''
|
|
end
|
|
|
|
# 课程层级
|
|
def major_major_level
|
|
type = ""
|
|
case self.major_level
|
|
when 1
|
|
type = "研究生"
|
|
when 2
|
|
type = "本科"
|
|
when 3
|
|
type = "专科"
|
|
end
|
|
type
|
|
end
|
|
|
|
end
|