Skip to content

Commit

Permalink
Fix for mongoid 3
Browse files Browse the repository at this point in the history
  • Loading branch information
venetanji committed Jul 25, 2012
1 parent e934f68 commit 413a819
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rest_in_place.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ class Engine < Rails::Engine

def self.include_root_in_json?
if defined?(Mongoid)
Mongoid.config.include_root_in_json
if defined? Mongoid::Config
Mongoid::Config.include_root_in_json
else
Mongoid.config.include_root_in_json
end
elsif defined?(ActiveRecord)
ActiveRecord::Base.include_root_in_json
else
Expand Down

0 comments on commit 413a819

Please sign in to comment.