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_vote.rb

11 lines
373 B

6 years ago
class PollVote < ApplicationRecord
# attr_accessible :poll_answers_id, :poll_questions_id, :user_id, :vote_text
# include Redmine::SafeAttributes
belongs_to :poll_answer, optional: true
belongs_to :poll_question
belongs_to :user
scope :find_current_vote,lambda {|k,v| where("#{k}": v)}
scope :find_vote_text,-> {where("vote_text IS NOT NULL")}
end