0
0
Fork 0

Fix detailed poll validation errors not being returned in the API (#10261)

No more "Owned poll is invalid"
This commit is contained in:
Eugen Rochko 2019-03-15 13:36:38 +01:00 committed by GitHub
parent c20d096e6a
commit 3ad3223b46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 10 deletions

View file

@ -71,7 +71,8 @@ class Status < ApplicationRecord
validates_with DisallowedHashtagsValidator
validates :reblog, uniqueness: { scope: :account }, if: :reblog?
validates :visibility, exclusion: { in: %w(direct limited) }, if: :reblog?
validates_associated :owned_poll
accepts_nested_attributes_for :owned_poll
default_scope { recent }