Plugin can't retrieve SiteSetting configured in admin ui


(Kevin Glinski) #1

I have a new plugin which has custom settings. I’m able to get the settings to show up in the UI, but when i call SiteSetting.purecloud_client_id it returns back only the value that is set in the yml file and never the configured value set in the admin UI. I assume I have something out of place but can’t figure out what.

plugin code to get the setting:
https://github.com/MyPureCloud/devcenter-discourse-plugin/blob/master/auth/pure_cloud_employee_authenticator.rb

purecloud_employee_client_id returns ‘default’ and not the value configured in the ui


(Kevin Glinski) #2

Seems to be a larger problem going on, if i remove all code from plugin.rb and just have
puts SiteSetting.purecloud_employee_client_id

it fails with a uninitialized constant SiteSetting (NameError) error


(Kevin Glinski) #3

i ended up moving my plugin to a private repo and stuck my id and secret in there :pensive:


#4

Generally speaking, is it possible to access SiteSetting from a plugin’s plugin.rb?
We are looking at this as a way to initialize a whole set of custom settings programmatically…