2015-01-08 17:42:46 +08:00
|
|
|
class Poll < ActiveRecord::Base
|
|
|
|
#attr_accessible :closed_at, :polls_group_id, :polls_name, :polls_status, :polls_type, :published_at, :user_id
|
|
|
|
include Redmine::SafeAttributes
|
|
|
|
|
|
|
|
belongs_to :user
|
2015-01-14 11:50:59 +08:00
|
|
|
has_many :poll_questions, :dependent => :destroy,:order => "#{PollQuestion.table_name}.question_number"
|
2015-01-08 17:42:46 +08:00
|
|
|
has_many :poll_users, :dependent => :destroy
|
|
|
|
has_many :users, :through => :poll_users #该文件被哪些用户提交答案过
|
|
|
|
end
|