"uninitialized constant ConfigTemplate" in foreman console

I'm trying to get around the locked PXELinux global default to get
discovery working.
Does anyone know the workaround for this?

Only thing I've found on this are references to Bug #10793:
Editing location or organization fails with NameError uninitialized
constant ConfigTemplate

which claims to have been solved over a year ago.

My foreman install is new from 2017.02.27, v1.14.1
Smart Proxies: TFTP, DNS, DHCP, Puppet, Puppet CA, BMC, Logs, and Discovery

I have two plugins:

foreman_discovery <http://github.com/theforeman/foreman_discovery>

8.0.0
foreman_setup <http://github.com/theforeman/foreman_setup>

5.0.0
in foreman-rake console

I try to unlock the PXELinux global default to add discovery:

ct = ConfigTemplate.find_by_name("PXELinux global default"); ct.locked =
false; ct.save!

I get:

NameError: uninitialized constant ConfigTemplate
from (irb):1
from
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/commands/console.rb:110:in
start&#39; from /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/commands/console.rb:9:instart'
from /usr/share/foreman/lib/tasks/console.rake:8:in block in &lt;top (required)&gt;&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:incall'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in
block in execute&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:ineach'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in
execute&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain'
from /opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in
mon_synchronize&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:ininvoke_with_call_chain'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:in
invoke&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:150:ininvoke_task'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in
block (2 levels) in top_level&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:ineach'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in
block in top_level&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:115:inrun_with_threads'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:100:in
top_level&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:78:inblock in run'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in
standard_exception_handling&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:inrun'
from /opt/rh/rh-ruby22/root/usr/bin/rake:33:in `<main>'