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.
pgfqe6ch8/app/models/school.rb

30 lines
955 B

6 years ago
# authorization_time 自动授权时间
# auto_users_trial: 自动授权
class School < ActiveRecord::Base
attr_accessible :name, :province, :pinyin, :city, :address, :logo_link,
:auto_users_trial, :shool_code, :authorization_time,
:identifier, :is_online, :video_desc, :video_name,:course_link, :course_name
has_many :courses
has_many :departments, :dependent => :destroy
has_many :shixun_schools, :dependent => :destroy
has_many :shixuns, :through => :shixun_schools
# 工程认证
has_many :users, :through => :ec_school_users
has_many :ec_school_users, :dependent => :destroy
has_many :ec_majors, :through => :ec_major_schools
has_many :ec_major_schools, :dependent => :destroy
# banner图片信息
has_many :school_images, :dependent => :destroy
# 视频附件
acts_as_attachable
scope :authorization, lambda{where(auto_users_trial: 1)}
def to_s
self.name.to_s
end
end