about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-03-15 13:36:38 +0100
committerGitHub <noreply@github.com>2019-03-15 13:36:38 +0100
commit3ad3223b466d8afbe8d11160a7351b34fe12c97a (patch)
treebc42e2dd461279c7d707535a6fa717f5015bf94b /app/models/status.rb
parentc20d096e6a251e1b84ac47b751d2eb065743dbc2 (diff)
Fix detailed poll validation errors not being returned in the API (#10261)
No more "Owned poll is invalid"
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index d029ff3cd..571167943 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -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 }