lib/mongoid/contextual/mongo.rb in mongoid-7.1.0.rc0 vs lib/mongoid/contextual/mongo.rb in mongoid-7.1.0
- old
+ new
@@ -9,10 +9,11 @@
require "mongoid/association/eager_loadable"
module Mongoid
module Contextual
class Mongo
+ extend Forwardable
include Enumerable
include Aggregable::Mongo
include Atomic
include Association::EagerLoadable
include Queryable
@@ -347,10 +348,10 @@
criteria.send(:merge_type_selection)
@view = collection.find(criteria.selector, session: _session)
apply_options
end
- delegate(:database_field_name, to: :@klass)
+ def_delegator :@klass, :database_field_name
# Get the last document in the database for the criteria's selector.
#
# @example Get the last document.
# context.last