lib/rocket_job/plugins/document.rb in rocketjob-2.0.0.rc2 vs lib/rocket_job/plugins/document.rb in rocketjob-2.0.0.rc3
- old
+ new
@@ -4,20 +4,23 @@
require 'mongo_ha'
require 'mongo_mapper'
module RocketJob
module Plugins
- # Prevent more than one instance of this job class from running at a time
+ # Base class for storing models in MongoDB
module Document
+ autoload :Static, 'rocket_job/plugins/document/static'
+
extend ActiveSupport::Concern
include MongoMapper::Document
+ include RocketJob::Plugins::Document::Static
included do
# Add after_initialize & after_find callbacks
define_model_callbacks :initialize, :find, :only => [:after]
# Prevent data in MongoDB from re-defining the model behavior
- #self.static_keys = true
+ self.static_keys = true
# Turn off embedded callbacks. Slow and not used for Jobs
embedded_callbacks_off
end