lib/mongo_mapper_ext.rb in rails-ext-0.2.17 vs lib/mongo_mapper_ext.rb in rails-ext-0.2.18
- old
+ new
@@ -1,5 +1,25 @@
require 'mongo_mapper'
-%w{fixes migration mongo_mapper multitenant object_id view_helpers}.each do |file|
+
+[
+ 'fixes',
+ 'migration',
+ 'mongo_mapper',
+ 'view_helpers',
+ 'db_config',
+
+ 'plugins/default_scope',
+ 'plugins/attributes_cache',
+ 'plugins/micelaneous',
+].each do |file|
require "#{File.dirname __FILE__}/mongo_mapper_ext/#{file}"
-end
+end
+
+module CommonPluginsAddition
+ def self.included(model)
+ model.plugin MongoMapper::Plugins::DefaultScope
+ model.plugin MongoMapper::Plugins::AttributesCache
+ model.plugin MongoMapper::Plugins::Micelaneous
+ end
+end
+MongoMapper::Document.append_inclusions(CommonPluginsAddition)
\ No newline at end of file