Sha256: 723abb2e0f3e9d72258cc3d25f23457b3674b3c9f1fc22b3ab5c4eb397c43135

Contents?: true

Size: 410 Bytes

Versions: 14

Compression:

Stored size: 410 Bytes

Contents

require 'mongoid/factory'

module RocketJob
  # Don't convert to Mongoid::Factory since it conflicts with Mongoid use.
  module MongoidFactory
    def from_db(klass, attributes = nil, criteria = nil)
      obj                 = super(klass, attributes, criteria)
      obj.collection_name = criteria.collection_name if criteria
      obj
    end
  end
end

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

Version data entries

14 entries across 14 versions & 1 rubygems

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