lib/mongoid/contextual/mongo.rb in mongoid-3.0.17 vs lib/mongoid/contextual/mongo.rb in mongoid-3.0.18
- old
+ new
@@ -217,9 +217,11 @@
criteria.send(:merge_type_selection)
@query = collection.find(criteria.selector)
apply_options
end
+ delegate(:database_field_name, to: :@klass)
+
# Get the last document in the database for the criteria's selector.
#
# @example Get the last document.
# context.last
#