Revert "FIX: constant lookup error when exporting theme"

This reverts commit 1eda8c50f0.
This commit is contained in:
Joffrey JAFFEUX 2017-12-14 11:40:08 +01:00
parent 813df1a3fb
commit 041deac67a
3 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -91,3 +91,7 @@ class ThemeFieldWithEmbeddedUploadsSerializer < ThemeFieldSerializer
Base64.encode64(raw)
end
end
class ThemeWithEmbeddedUploadsSerializer < ThemeSerializer
has_many :theme_fields, serializer: ThemeFieldWithEmbeddedUploadsSerializer, embed: :objects
end

View File

@ -1,3 +0,0 @@
class ThemeWithEmbeddedUploadsSerializer < ThemeSerializer
has_many :theme_fields, serializer: ThemeFieldWithEmbeddedUploadsSerializer, embed: :objects
end