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.
educoder/app/models/poll_user.rb

11 lines
398 B

6 years ago
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