Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mongomapper/mongomapper
...
head fork: SaschaKonietzke/mongomapper
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 10 additions and 3 deletions.
  1. +10 −3 lib/mongo_mapper/plugins.rb
View
13 lib/mongo_mapper/plugins.rb
@@ -6,9 +6,16 @@ def 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)
+ if RUBY_VERSION < "1.9" # updated for ruby 1.9 support
+ extend mod::ClassMethods if mod.const_defined?(:ClassMethods)
+ include mod::InstanceMethods if mod.const_defined?(:InstanceMethods)
+ mod.configure(self) if mod.respond_to?(:configure)
+ else
+ extend mod::ClassMethods if mod.const_defined?(:ClassMethods, false)
+ include mod::InstanceMethods if mod.const_defined?(:InstanceMethods, false)
+ mod.configure(self) if mod.respond_to?(:configure)
+ end
+
plugins << mod
end
end

No commit comments for this range

Something went wrong with that request. Please try again.