socialforge/app/models/course.rb

19 lines
383 B
Ruby
Raw Normal View History

2013-09-06 16:40:07 +08:00
class Course < ActiveRecord::Base
include Redmine::SafeAttributes
2013-09-12 17:25:40 +08:00
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state
2013-09-12 10:41:15 +08:00
belongs_to :project, :class_name => 'Project', :foreign_key => :extra
2013-09-06 16:40:07 +08:00
has_many :bid
2013-09-12 17:25:40 +08:00
validates_presence_of :time
2013-09-06 16:40:07 +08:00
safe_attributes 'extra',
'time',
'name',
'extra',
2013-09-12 10:41:15 +08:00
'code',
2013-09-12 17:25:40 +08:00
'location',
'tea_id',
'state'
2013-09-12 10:41:15 +08:00
2013-09-06 16:40:07 +08:00
end