app/controllers/pulitzer/versions_controller.rb in pulitzer-0.5.6 vs app/controllers/pulitzer/versions_controller.rb in pulitzer-0.5.7
- old
+ new
@@ -11,19 +11,20 @@
def update
status_updater = Pulitzer::UpdateVersionStatus.new(@version, @status)
if status_updater.errors.any?
processing_version = @version
- flash_message = processing_version.errors.first
+ flash_message = status_updater.errors.join("<br>").html_safe
status = :conflict
else
processing_version = status_updater.call
if processing_version
if processing_version.errors.empty?
status = :ok
flash_message = "The new version of #{@post.title} has been activated."
else
status = :conflict
+ flash_message = processing_version.errors.full_messages.join("<br>").html_safe
end
else
flash[:notice] = "The post was successfully removed."
render json: {class_triggers: {"hooch.ReloadPage" => posts_path(post_type_id: @version.post.post_type.id) }} and return
end