Sha256: 0a99d1ee45810dd9de3357d2016e820018ab821beefe364ab6f0458a7122c1fd
Contents?: true
Size: 744 Bytes
Versions: 3
Compression:
Stored size: 744 Bytes
Contents
# encoding: UTF-8 module MongoMapper module Plugins include ActiveSupport::DescendantsTracker def plugins @plugins ||= [] end def plugin(mod) if ActiveSupport::Concern === mod include mod else warn "[DEPRECATED] Plugins must extend ActiveSupport::Concern" extend mod::ClassMethods if mod.const_defined?(:ClassMethods) include mod::InstanceMethods if mod.const_defined?(:InstanceMethods) mod.configure(self) if mod.respond_to?(:configure) end direct_descendants.each {|model| model.send(:include, mod) } plugins << mod end def included(base = nil, &block) direct_descendants << base if base super end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mongo_mapper-0.9.2 | lib/mongo_mapper/plugins.rb |
mongo_mapper-0.9.1 | lib/mongo_mapper/plugins.rb |
mongo_mapper-0.9.0 | lib/mongo_mapper/plugins.rb |