From 041deac67a31ee90e2a211d6e025a6264a263b9e Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 14 Dec 2017 11:40:08 +0100 Subject: [PATCH] Revert "FIX: constant lookup error when exporting theme" This reverts commit 1eda8c50f012d0313a6956a6c8b8e56db64df4b3. --- app/controllers/admin/themes_controller.rb | 2 +- app/serializers/theme_serializer.rb | 4 ++++ app/serializers/theme_with_embedded_uploads_serializer.rb | 3 --- 3 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 app/serializers/theme_with_embedded_uploads_serializer.rb diff --git a/app/controllers/admin/themes_controller.rb b/app/controllers/admin/themes_controller.rb index 593e91a2f70..e83cebea5e1 100644 --- a/app/controllers/admin/themes_controller.rb +++ b/app/controllers/admin/themes_controller.rb @@ -190,7 +190,7 @@ class Admin::ThemesController < Admin::AdminController response.headers['Content-Disposition'] = "attachment; filename=#{@theme.name.parameterize}.dcstyle.json" response.sending_file = true - render json: ::ThemeWithEmbeddedUploadsSerializer.new(@theme, root: 'theme') + render json: ThemeWithEmbeddedUploadsSerializer.new(@theme, root: 'theme') end end diff --git a/app/serializers/theme_serializer.rb b/app/serializers/theme_serializer.rb index 08a110dc940..78532e399a9 100644 --- a/app/serializers/theme_serializer.rb +++ b/app/serializers/theme_serializer.rb @@ -91,3 +91,7 @@ class ThemeFieldWithEmbeddedUploadsSerializer < ThemeFieldSerializer Base64.encode64(raw) end end + +class ThemeWithEmbeddedUploadsSerializer < ThemeSerializer + has_many :theme_fields, serializer: ThemeFieldWithEmbeddedUploadsSerializer, embed: :objects +end diff --git a/app/serializers/theme_with_embedded_uploads_serializer.rb b/app/serializers/theme_with_embedded_uploads_serializer.rb deleted file mode 100644 index d54035cf1ab..00000000000 --- a/app/serializers/theme_with_embedded_uploads_serializer.rb +++ /dev/null @@ -1,3 +0,0 @@ -class ThemeWithEmbeddedUploadsSerializer < ThemeSerializer - has_many :theme_fields, serializer: ThemeFieldWithEmbeddedUploadsSerializer, embed: :objects -end