lib/blind_index/extensions.rb in blind_index-0.2.0 vs lib/blind_index/extensions.rb in blind_index-0.2.1

- old
+ new

@@ -4,11 +4,11 @@ module TableMetadata def resolve_column_aliases(hash) new_hash = super if has_blind_indexes? hash.each do |key, _| - if (bi = klass.blind_indexes[key]) + if (bi = klass.blind_indexes[key]) && !new_hash[key].is_a?(ActiveRecord::StatementCache::Substitute) new_hash[bi[:bidx_attribute]] = BlindIndex.generate_bidx(new_hash.delete(key), bi) end end end new_hash @@ -27,10 +27,10 @@ module PredicateBuilder def resolve_column_aliases(klass, hash) new_hash = super if has_blind_indexes?(klass) hash.each do |key, _| - if (bi = klass.blind_indexes[key]) + if (bi = klass.blind_indexes[key]) && !new_hash[key].is_a?(ActiveRecord::StatementCache::Substitute) new_hash[bi[:bidx_attribute]] = BlindIndex.generate_bidx(new_hash.delete(key), bi) end end end new_hash