I have this method:
def current_organization
return @current_organization if defined?(@current_organization)
subdomain = request.subdomain.to_s
return @current_organization = nil if subdomain.blank?
return @current_organization = nil if Allowable::DeniedSlugs.include?(subdomain)
@current_organization = Organization.find_by(slug: subdomain)
end
Because this file is typed: strict, I need to declare @current_organization, but this would mean that checking defined? would always be true. What is the correct pattern for handling nil for methods like this