Module: RocketJob::MongoidFactory

Defined in:
lib/rocket_job/extensions/mongoid/factory.rb

Overview

Don’t convert to Mongoid::Factory since it conflicts with Mongoid use.

Instance Method Summary collapse

Instance Method Details

#from_db(klass, attributes = nil, criteria = nil, selected_fields = nil) ⇒ Object



6
7
8
9
10
# File 'lib/rocket_job/extensions/mongoid/factory.rb', line 6

def from_db(klass, attributes = nil, criteria = nil, selected_fields = nil)
  obj                 = super(klass, attributes, criteria, selected_fields)
  obj.collection_name = criteria.collection_name if criteria
  obj
end