lib/rocket_job/extensions/mongoid/contextual/mongo.rb in rocketjob-5.1.1 vs lib/rocket_job/extensions/mongoid/contextual/mongo.rb in rocketjob-5.2.0.beta1

- old
+ new

@@ -1,12 +1,14 @@ ::Mongoid::Contextual::Mongo module Mongoid module Contextual class Mongo def initialize(criteria) - @criteria, @klass, @cache = criteria, criteria.klass, criteria.options[:cache] + @criteria = criteria + @klass = criteria.klass + @cache = criteria.options[:cache] # Only line changed is here, get collection name from criteria, not @klass - #@collection = @klass.collection + # @collection = @klass.collection @collection = criteria.collection criteria.send(:merge_type_selection) @view = collection.find(criteria.selector, session: _session) apply_options