Skip to content
Browse files

ensure Mongoid::Document is defined before loading Mongoid adapter - …

…closes #359
  • Loading branch information...
1 parent ff13a82 commit cb9777be5fca8d7a244b9a29fef88626753b8e39 @ryanb committed May 17, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/cancan.rb
View
2 lib/cancan.rb
@@ -10,4 +10,4 @@
require 'cancan/model_adapters/default_adapter'
require 'cancan/model_adapters/active_record_adapter' if defined? ActiveRecord
require 'cancan/model_adapters/data_mapper_adapter' if defined? DataMapper
-require 'cancan/model_adapters/mongoid_adapter' if defined? Mongoid
+require 'cancan/model_adapters/mongoid_adapter' if defined?(Mongoid) && defined?(Mongoid::Document)

0 comments on commit cb9777b

Please sign in to comment.
Something went wrong with that request. Please try again.