Disabling "Auto Provisioning" does not work

Problem:
First I enabled the “Auto Provisioning” setting to provision some host autonomously using discovery rules, which works fine:

Next I disable the setting again, to auto provision some hosts (also using discovery rules), but with manual intervention:

However, even though the setting is disabled, the discovered hosts are still automatically provisioned without requiring user intervention.

This looks like a bug honoring the new value?

Expected outcome:

The hosts should end up in the discovered hosts lists and only be provisioned after manual intervention.

Foreman and Proxy versions:
Foreman 3.2.1

Foreman and Proxy plugin versions:
BMC Version 3.2.1
Discovery Version 1.0.5
Dynflow Version 0.7.0
SSH Version 0.5.3
Salt Version 4.0.0
TFTP Version 3.2.1

Distribution and version:
CentOS 7

Other relevant data:

Setting the value using hammer has te same effect. The feedback of the new value seems to be missing in the output:

$ hammer settings set --name discovery_auto --value False
Setting [discovery_auto] updated to [].

Requesting the value using hammer seems to return random true/false values:

$ hammer settings info --name discovery_auto
Id:            discovery_auto
Name:          discovery_auto
Description:   Automatically provision newly discovered hosts, according to the provisioning rules
Category:      Discovered
Settings type: boolean
Value:         true

$ hammer settings info --name discovery_auto
Id:            discovery_auto
Name:          discovery_auto
Description:   Automatically provision newly discovered hosts, according to the provisioning rules
Category:      Discovered
Settings type: boolean
Value:         false

$ hammer settings info --name discovery_auto
Id:            discovery_auto
Name:          discovery_auto
Description:   Automatically provision newly discovered hosts, according to the provisioning rules
Category:      Discovered
Settings type: boolean
Value:         true

The foreman database does seem to get updated with the correct default (false) value as far as I can tell:

foreman=# select name, value, "default" from settings where name = 'discovery_auto';
      name      | value |  default  
----------------+-------+-----------
 discovery_auto |       | --- false+
                |       | ...
(1 row)

Only after restarting the foreman service, it seems that the “Auto Provisioning” setting is really disabled in memory.

Does anyone know how this works in the code flow of the plugin. I’m no ruby export, but can try dig up some more information and a possible fix with some pointers.