FIX: if post creation fails, raise an exception

This commit is contained in:
Sam 2015-08-05 10:47:38 +10:00
parent 2b2ae4bfe7
commit 34122e06df
1 changed files with 4 additions and 0 deletions

View File

@ -67,6 +67,10 @@ class QueuedPost < ActiveRecord::Base
creator = PostCreator.new(user, create_options.merge(skip_validations: true))
created_post = creator.create
unless created_post && creator.errors.blank?
raise StandardError, "Failed to create post #{raw[0..100]} #{creator.errors}"
end
if user.blocked?
user.update_columns(blocked: false)
end