require 'mongo_mapper' [ '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 module CommonPluginsAddition def self.included(model) model.plugin MongoMapper::Plugins::DefaultScope model.plugin MongoMapper::Plugins::AttributesCache model.plugin MongoMapper::Plugins::Micelaneous model.attr_protected :id, :_id, :_type, :created_at, :updated_at end end MongoMapper::Document.append_inclusions(CommonPluginsAddition)