I\'m pretty sure the error has nothing to do with the actual content of the TenantIdLoader module. Instead, it has something to do with ActiveSupport
TenantIdLoader
ActiveSupport
Changing ModuleName to 'ModuleName'.constantize solved the issue for me.
ModuleName
'ModuleName'.constantize