Permalink
Browse files

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

…loses #359
  • Loading branch information...
ryanb committed May 17, 2011
1 parent ff13a82 commit cb9777be5fca8d7a244b9a29fef88626753b8e39
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/cancan.rb
View
@@ -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.