lib/ferret_adapter/adapter.rb in dm-ferret-adapter-1.1.0 vs lib/ferret_adapter/adapter.rb in dm-ferret-adapter-1.2.0.rc1
- old
+ new
@@ -30,10 +30,10 @@
key = query.model.key(name).first
ferret_query = dm_query_to_ferret_query(query)
@index.search(ferret_query, :limit => query.limit).map do |lazy_doc|
- DataMapper::Ext::Array.to_hash(fields.map { |p| [ p, p.typecast(lazy_doc[p.field]) ] }).update(
+ Hash[ fields.map { |p| [ p, p.typecast(lazy_doc[p.field]) ] } ].update(
key.field => key.typecast(lazy_doc[:id])
)
end
end