socialforge/app/models/poll.rb

10 lines
442 B
Ruby

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
has_many :poll_questions, :dependent => :destroy,:order => "#{PollQuestion.table_name}.question_number"
has_many :poll_users, :dependent => :destroy
has_many :users, :through => :poll_users #该文件被哪些用户提交答案过
end