Sha256: 352a2a03eff0b055334099dd89e680799b0ed4f48700fc0b082088afec0d98b2

Contents?: true

Size: 1.47 KB

Versions: 5

Compression:

Stored size: 1.47 KB

Contents

module MongoMapper
  module Plugins
    def plugins
      @plugins ||= []
    end

    def plugin(mod)
      extend mod::ClassMethods     if mod.const_defined?(:ClassMethods)
      include mod::InstanceMethods if mod.const_defined?(:InstanceMethods)
      mod.configure(self)          if mod.respond_to?(:configure)
      plugins << mod
    end

    autoload :Callbacks,      'mongo_mapper/plugins/callbacks'
    autoload :Clone,          'mongo_mapper/plugins/clone'
    autoload :Descendants,    'mongo_mapper/plugins/descendants'
    autoload :Dirty,          'mongo_mapper/plugins/dirty'
    autoload :Equality,       'mongo_mapper/plugins/equality'
    autoload :IdentityMap,    'mongo_mapper/plugins/identity_map'
    autoload :Inspect,        'mongo_mapper/plugins/inspect'
    autoload :Keys,           'mongo_mapper/plugins/keys'
    autoload :Logger,         'mongo_mapper/plugins/logger'
    autoload :Modifiers,      'mongo_mapper/plugins/modifiers'
    autoload :Persistence,    'mongo_mapper/plugins/persistence'
    autoload :Protected,      'mongo_mapper/plugins/protected'
    autoload :Rails,          'mongo_mapper/plugins/rails'
    autoload :Serialization,  'mongo_mapper/plugins/serialization'
    autoload :Timestamps,     'mongo_mapper/plugins/timestamps'
    autoload :Userstamps,     'mongo_mapper/plugins/userstamps'
    autoload :Validations,    'mongo_mapper/plugins/validations'
  end
end

require 'mongo_mapper/plugins/associations'
require 'mongo_mapper/plugins/pagination'

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mongo_mapper-0.7.6 lib/mongo_mapper/plugins.rb
mongo_mapper-0.7.5 lib/mongo_mapper/plugins.rb
mongo_mapper_ign-0.7.4 lib/mongo_mapper/plugins.rb
mongo_mapper-0.7.4 lib/mongo_mapper/plugins.rb
mongo_mapper-0.7.3 lib/mongo_mapper/plugins.rb