diff --git a/lib/aasm/persistence.rb b/lib/aasm/persistence.rb index 2a7d4c9..3efe50e 100644 --- a/lib/aasm/persistence.rb +++ b/lib/aasm/persistence.rb @@ -9,6 +9,9 @@ module AASM if hierarchy.include?("ActiveRecord::Base") require File.join(File.dirname(__FILE__), 'persistence', 'active_record_persistence') base.send(:include, AASM::Persistence::ActiveRecordPersistence) + elsif hierarchy.include?("Mongoid::Document") + require File.join(File.dirname(__FILE__), 'persistence', 'mongoid_persistence') + base.send(:include, AASM::Persistence::MongoidPersistence) end end end