We've moved discussions to Discord

Suggestion: set_current_request_details.rb to skip subdomains if request.subdomains empty

Dr Nic Williams
I do not have access to https://gitlab.com/gorails/jumpstart-pro yet so submitting suggestion here:

In set_current_request_details.rb there is a test for Jumpstart::Multitenancy.subdomain? and if that's set then it assumes request.subdomains will always have a value. But it might not, and there might be 1+ Accounts that do not yet have a subdomain configured, in which case Account.find_by(subdomain: request.subdomains.first) becomes Account.find_by(subdomain: nil) which will return the first Acccount without a subdomain.

Instead, perhaps change line 24 to:

      if Jumpstart::Multitenancy.subdomain? && request.subdomains.size > 0
        Current.account ||= Account.find_by(subdomain: request.subdomains.first)
      end
Chris Oliver
Ah yes, absolutely should be checking if there is more than one subdomain. I'll get that updated. 👍
Notifications
You’re not receiving notifications from this thread.