class PollUser < ApplicationRecord
  belongs_to :poll
  belongs_to :user

  scope :current_poll_user, lambda { |user_id,poll_id| where(user_id: user_id,poll_id:poll_id)}
  scope :commit_by_status, lambda { |s| where(commit_status: s)}
  scope :find_by_group_ids, lambda { |ids| where(user_id: ids) }
  scope :search_by_poll, lambda {|ids| where(poll_id:ids)}  #根据问卷来查找
end

