FEATURE: add child theme components in theme metadata.

Now theme creators can add an array of child theme components in about.json file for a top level theme.
This commit is contained in:
Vinoth Kannan
2020-03-05 18:28:18 +05:30
parent 83e649d08e
commit d953c908d2
2 changed files with 15 additions and 0 deletions

View File

@ -40,6 +40,7 @@ class RemoteTheme < ActiveRecord::Base
theme ||= Theme.new(user_id: user&.id || -1, name: theme_info["name"])
theme.component = theme_info["component"].to_s == "true"
theme.child_components = theme_info["components"].presence || []
remote_theme = new
remote_theme.theme = theme
@ -63,6 +64,7 @@ class RemoteTheme < ActiveRecord::Base
theme_info = RemoteTheme.extract_theme_info(importer)
component = [true, "true"].include?(theme_info["component"])
theme = Theme.new(user_id: user&.id || -1, name: theme_info["name"], component: component)
theme.child_components = theme_info["components"].presence || []
remote_theme = new
theme.remote_theme = remote_theme