mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 01:24:43 +08:00
Revert "FIX: constant lookup error when exporting theme"
This reverts commit 1eda8c50f012d0313a6956a6c8b8e56db64df4b3.
This commit is contained in:
@ -190,7 +190,7 @@ class Admin::ThemesController < Admin::AdminController
|
|||||||
|
|
||||||
response.headers['Content-Disposition'] = "attachment; filename=#{@theme.name.parameterize}.dcstyle.json"
|
response.headers['Content-Disposition'] = "attachment; filename=#{@theme.name.parameterize}.dcstyle.json"
|
||||||
response.sending_file = true
|
response.sending_file = true
|
||||||
render json: ::ThemeWithEmbeddedUploadsSerializer.new(@theme, root: 'theme')
|
render json: ThemeWithEmbeddedUploadsSerializer.new(@theme, root: 'theme')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -91,3 +91,7 @@ class ThemeFieldWithEmbeddedUploadsSerializer < ThemeFieldSerializer
|
|||||||
Base64.encode64(raw)
|
Base64.encode64(raw)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class ThemeWithEmbeddedUploadsSerializer < ThemeSerializer
|
||||||
|
has_many :theme_fields, serializer: ThemeFieldWithEmbeddedUploadsSerializer, embed: :objects
|
||||||
|
end
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
class ThemeWithEmbeddedUploadsSerializer < ThemeSerializer
|
|
||||||
has_many :theme_fields, serializer: ThemeFieldWithEmbeddedUploadsSerializer, embed: :objects
|
|
||||||
end
|
|
Reference in New Issue
Block a user