lib/rocket_job/extensions/mongoid/factory.rb in rocketjob-3.4.3 vs lib/rocket_job/extensions/mongoid/factory.rb in rocketjob-3.5.0
- old
+ new
@@ -1,13 +1,15 @@
require 'mongoid/factory'
module RocketJob
- module MongoidFactory
- def from_db(*args)
- super(*args)
- rescue NameError => exc
- RocketJob::Job.instantiate(attributes, selected_fields)
+ module Mongoid
+ module Factory
+ def from_db(*args)
+ super(*args)
+ rescue NameError
+ RocketJob::Job.instantiate(attributes, selected_fields)
+ end
end
end
end
-::Mongoid::Factory.include(RocketJob::MongoidFactory)
+::Mongoid::Factory.extend(RocketJob::Mongoid::Factory)