Validate presence of 'poll_id' attribute on Poll::Question model
Fixes #1831 On branch aperez-validate-poll-question-is-selected Changes to be committed: modified: app/models/poll/question.rb modified: spec/models/poll/question_spec.rb modified: spec/features/admin/poll/polls_spec.rb
This commit is contained in:
@@ -20,6 +20,7 @@ class Poll::Question < ActiveRecord::Base
|
||||
|
||||
validates :title, presence: true
|
||||
validates :author, presence: true
|
||||
validates :poll_id, presence: true
|
||||
|
||||
validates :title, length: { minimum: 4 }
|
||||
validates :description, length: { maximum: Poll::Question.description_max_length }
|
||||
|
||||
Reference in New Issue
Block a user