Skip to content

Commit f916dfc

Browse files
Define engine_modules in application config to be managed by external engines
1 parent 42d87e9 commit f916dfc

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

app/controllers/gobierto_admin/sites_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def find_site
115115
end
116116

117117
def get_site_modules
118-
APP_CONFIG[:site_modules].map { |site_module| OpenStruct.new(site_module) }
118+
APP_CONFIG[:site_modules].union(Rails.configuration.engine_modules).map { |site_module| OpenStruct.new(site_module) }
119119
end
120120

121121
def set_auth_modules

config/application.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class Application < Rails::Application
7474
config.engine_sass_config_overrides = []
7575
config.engine_sass_theme_dependencies = []
7676
config.gobierto_engines_themes = {}
77+
config.engine_modules = []
7778

7879
# Custom field plugins
7980
config.custom_field_plugins = {}

config/initializers/app_config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
SITE_MODULES = APP_CONFIG[:site_modules].map do |site_module|
5+
SITE_MODULES = APP_CONFIG[:site_modules].union(Rails.configuration.engine_modules).map do |site_module|
66
site_module[:namespace]
77
end
88

0 commit comments

Comments
 (0)