Skip to content

Commit

Permalink
Define engine_modules in application config to be managed by external…
Browse files Browse the repository at this point in the history
… engines
  • Loading branch information
entantoencuanto committed Sep 10, 2021
1 parent 42d87e9 commit f916dfc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/gobierto_admin/sites_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def find_site
end

def get_site_modules
APP_CONFIG[:site_modules].map { |site_module| OpenStruct.new(site_module) }
APP_CONFIG[:site_modules].union(Rails.configuration.engine_modules).map { |site_module| OpenStruct.new(site_module) }
end

def set_auth_modules
Expand Down
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Application < Rails::Application
config.engine_sass_config_overrides = []
config.engine_sass_theme_dependencies = []
config.gobierto_engines_themes = {}
config.engine_modules = []

# Custom field plugins
config.custom_field_plugins = {}
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/app_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

APP_CONFIG = Rails.application.config_for(:application).with_indifferent_access

SITE_MODULES = APP_CONFIG[:site_modules].map do |site_module|
SITE_MODULES = APP_CONFIG[:site_modules].union(Rails.configuration.engine_modules).map do |site_module|
site_module[:namespace]
end

Expand Down

0 comments on commit f916dfc

Please sign in to comment.