Class: ThemeObjectsSettingMetadataSerializer
Instance Method Summary
collapse
expire_cache_fragment!, fragment_cache
#include!
Instance Method Details
#categories ⇒ Object
6
7
8
9
10
11
12
13
|
# File 'app/serializers/theme_objects_setting_metadata_serializer.rb', line 6
def categories
object
.categories(scope)
.reduce({}) do |acc, category|
acc[category.id] = BasicCategorySerializer.new(category, scope: scope, root: false).as_json
acc
end
end
|
#property_descriptions ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/serializers/theme_objects_setting_metadata_serializer.rb', line 15
def property_descriptions
locales = {}
key = "theme_metadata.settings.#{object.name}.schema.properties."
object.theme.internal_translations.each do |internal_translation|
if internal_translation.key.start_with?(key)
locales[internal_translation.key.delete_prefix(key)] = internal_translation.value
end
end
locales
end
|