lib/blind_index/extensions.rb in blind_index-2.6.0 vs lib/blind_index/extensions.rb in blind_index-2.6.1

- old
+ new

@@ -14,10 +14,10 @@ # https://github.com/rails/rails/commit/56f30962b84fc53b76001301fb830c1594fd377e def build(attribute, value, *args) if table.has_blind_indexes? && (bi = table.send(:klass).blind_indexes[attribute.name.to_sym]) && !value.is_a?(ActiveRecord::StatementCache::Substitute) attribute = attribute.relation[bi[:bidx_attribute]] value = - if value.is_a?(Array) + if value.is_a?(Array) || (defined?(Set) && value.is_a?(Set)) value.map { |v| BlindIndex.generate_bidx(v, **bi) } else BlindIndex.generate_bidx(value, **bi) end end