Sha256: 2b4e5b33f380a367adbbdb52f075e63601eaf1e2343854d6ddfc2b3121511a6f

Contents?: true

Size: 367 Bytes

Versions: 14

Compression:

Stored size: 367 Bytes

Contents

require 'mongoid/factory'

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

::Mongoid::Factory.extend(RocketJob::Mongoid5Factory)

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rocketjob-5.1.1 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-5.1.0 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-5.0.0 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-5.0.0.rc1 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-5.0.0.beta4 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-5.0.0.beta3 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-5.0.0.beta2 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-5.0.0.beta lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-4.3.0.beta2 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-4.3.0.beta lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-4.2.0 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-4.1.1 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-4.1.0 lib/rocket_job/extensions/mongoid_5/factory.rb
rocketjob-4.0.0 lib/rocket_job/extensions/mongoid_5/factory.rb