I’m aware that
after_initialize allows us to have access to the loaded properties in
SiteSetting but I’m struggling to update my
Since ruby isn’t my working language it’s more difficult for me to follow.
lib/plugin/instance.rb I see this may be responsible for handling the loading of our plugins.
But simplying wrapping my class in
after_initialize do …
end doesn’t seem to work. (Nothing appears to have loaded at all if I do that).
def register_middleware(omniauth) omniauth.provider :steam, SiteSetting.discourse_steam_login_api_key || ENV['STEAM_WEB_API_KEY'] end
Is there anything obvious I’m missing?
The problem essentially is that - when
register_middleware is called, I don’t think my
SiteSetting property is yet loaded.
I’ve set the
enabled_site_settings at the top of the file:
enabled_site_setting :discourse_steam_login_enabled enabled_site_setting :discourse_steam_login_api_key
Some plugins only use their enabled flag, others add more properties this way. So it’s a little confusing what the purpose of
enabled_site_setting is, some clarification on that as well if possible.
I’m hoping this is something relatively simple I’ve overlooked