Skip to content

Commit 8b72781

Browse files
authored
change from present? to ruby-only check
I'm not sure where `present?` (a method defined in Rails) is being pulled in from, but for me, it's not: ```sh NoMethodError: undefined method `present?' for nil (NoMethodError) elsif multi_tenant.present? ^^^^^^^^^ ``` I wonder if `elsif multi_tenant` is good enough, or do we need to explicitly check that if it has an `empty?` method, that the `empty?` method returns false (similar to what `present?` does)
1 parent 2365fa3 commit 8b72781

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/weaviate/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def create(
4545
req.body["properties"] = properties unless properties.nil?
4646
if multi_tenant.is_a?(Hash)
4747
req.body["multiTenancyConfig"] = multi_tenant
48-
elsif multi_tenant.present?
48+
elsif multi_tenant && !(multi_tenant.respond_to?(:empty?) && multi_tenant.empty?)
4949
req.body["multiTenancyConfig"] = {enabled: true}
5050
end
5151
req.body["invertedIndexConfig"] = inverted_index_config unless inverted_index_config.nil?

0 commit comments

Comments
 (0)