lib/mongoid/contextual/mongo.rb in mongoid-5.1.3 vs lib/mongoid/contextual/mongo.rb in mongoid-5.1.4
- old
+ new
@@ -292,11 +292,10 @@
# @return [ Array ] The result of mapping.
def map(field = nil, &block)
if block_given?
super(&block)
else
- field = field.to_sym
- criteria.only(field).map(&field.to_proc)
+ criteria.pluck(field)
end
end
# Create the new Mongo context. This delegates operations to the
# underlying driver.