From 601e58d5c507e608d223d514b7e8ab095550934b Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 12 Aug 2019 19:20:33 -0500 Subject: [PATCH] Fix exception in legacy /post/index.xml endpoint. Fixes intermittent `uninitialized constant LegacyController::Builder` exceptions. --- Gemfile | 1 + Gemfile.lock | 1 + app/controllers/legacy_controller.rb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index e21b3db31..4af34bc8b 100644 --- a/Gemfile +++ b/Gemfile @@ -44,6 +44,7 @@ gem 'webpacker', '>= 4.0.x' gem 'retriable' gem 'redis' gem 'request_store' +gem 'builder' gem 'term-ansicolor', require: "term/ansicolor" # needed for looser jpeg header compat diff --git a/Gemfile.lock b/Gemfile.lock index c89063400..318c4ee05 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -451,6 +451,7 @@ DEPENDENCIES bcrypt bigquery! bootsnap + builder capistrano (~> 3.10) capistrano-deploytags (~> 1.0.0) capistrano-rails diff --git a/app/controllers/legacy_controller.rb b/app/controllers/legacy_controller.rb index 202052d20..25740baa5 100644 --- a/app/controllers/legacy_controller.rb +++ b/app/controllers/legacy_controller.rb @@ -7,7 +7,7 @@ class LegacyController < ApplicationController respond_with(@posts) do |format| format.xml do - xml = Builder::XmlMarkup.new(indent: 2) + xml = ::Builder::XmlMarkup.new(indent: 2) xml.instruct! xml.posts do @posts.each { |attrs| xml.post(attrs) }